• W
    share_pool: Clear the usage of node_id and device_id · 5fe50a03
    Wang Wensheng 提交于
    ascend inclusion
    category: bugfix
    bugzilla: https://gitee.com/openeuler/kernel/issues/I4SON8
    CVE: NA
    
    -------------------------------------------------
    
    Device_id is used for DVPP to select the correct virtual address space
    and node_id is used to specify the node where we want to alloc physical
    memory from. Those two don't have to be the same in theory.
    
    Actually, the process runs always on the numa nodes corresponding to the
    device the process used and the node with the same id as the device is
    always belongs the the device. So using device_id as node_id to alloc
    memory could work.
    
    However the number of numa nodes belongs to a specified device is not
    always one and we cannot use other numa nodes of the device.
    
    Here we introduce a new flag SP_SPEC_NODE_ID and add a bit-region in
    sp_flags for those who want to use other nodes belongs to a device. That
    is, if one want to specify the node_id, the new flag and the node_id
    should be both added to the sp_flags when calling sp_alloc() or
    sp_make_share_k2u(), otherwise the node with the same id as the device
    would be in use.
    Signed-off-by: NWang Wensheng <wangwensheng4@huawei.com>
    Reviewed-by: NWeilong Chen <chenweilong@huawei.com>
    Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
    5fe50a03
share_pool.h 16.3 KB