gpu: nvgpu: Expose NUMA domain id

This patch exposes the NUMA domain id for the
Linux device to userspace. This information is
necessary for userspace to make better utilization
of physical memory allocation and CPU scheduling.

Bug 3972227

Change-Id: I9ad0369076d22531e154074d616e5a23e374a7e9
Signed-off-by: Martin Radev <mradev@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2897294
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Martin Radev
2023-05-02 09:49:37 +03:00
committed by mobile promotions
parent 80a21343a0
commit cad414d310
2 changed files with 9 additions and 0 deletions

View File

@@ -399,6 +399,8 @@ static long gk20a_ctrl_ioctl_gpu_characteristics(
gpu.device_instance_id = priv->device_instance_id;
#endif
gpu.numa_domain_id = dev_to_node(dev_from_gk20a(g));
gpu.L2_cache_size = g->ops.ltc.determine_L2_size_bytes(g);
gpu.on_board_video_memory_size = 0; /* integrated GPU */

View File

@@ -220,6 +220,13 @@ struct nvgpu_gpu_characteristics {
__u32 rev;
__u32 num_gpc;
/*
* Specifies the NUMA domain for the GPU device
* A value of "-1" specifies no NUMA domain info.
*/
#define NVGPU_GPU_CHARACTERISTICS_NO_NUMA_INFO (-1)
__s32 numa_domain_id;
__u64 L2_cache_size; /* bytes */
__u64 on_board_video_memory_size; /* bytes */