Commit 5fe50a03 authored by Wang Wensheng's avatar Wang Wensheng Committed by Yang Yingliang
Browse files

share_pool: Clear the usage of node_id and device_id

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: default avatarWang Wensheng <wangwensheng4@huawei.com>
Reviewed-by: default avatarWeilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 38f74cfb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment