drm/ttm: Schedule delayed_delete worker closer
authorRajneesh Bhardwaj <rajneesh.bhardwaj@amd.com>
Sat, 11 Nov 2023 13:08:56 +0000 (08:08 -0500)
committerChristian König <christian.koenig@amd.com>
Mon, 27 Nov 2023 09:58:36 +0000 (10:58 +0100)
commitb0a7ce53d494c94dfacb5a877fc0668f2a688652
tree78c44755b876d2a89ce539cdaa14701973070d87
parent38f922a563aac3148ac73e73689805917f034cb5
drm/ttm: Schedule delayed_delete worker closer

Try to allocate system memory on the NUMA node the device is closest to
and try to run delayed_delete workers on a CPU of this node as well.

To optimize the memory clearing operation when a TTM BO gets freed by
the delayed_delete worker, scheduling it closer to a NUMA node where the
memory was initially allocated helps avoid the cases where the worker
gets randomly scheduled on the CPU cores that are across interconnect
boundaries such as xGMI, PCIe etc.

This change helps USWC GTT allocations on NUMA systems (dGPU) and AMD
APU platforms such as GFXIP9.4.3.

Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@amd.com>
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231111130856.1168304-1-rajneesh.bhardwaj@amd.com
Signed-off-by: Christian König <christian.koenig@amd.com>
drivers/gpu/drm/ttm/ttm_bo.c
drivers/gpu/drm/ttm/ttm_device.c