]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/ttm: Fix GPU MM stats during pool shrinking
authorMatthew Brost <matthew.brost@intel.com>
Sat, 2 May 2026 06:53:38 +0000 (23:53 -0700)
committerMatthew Brost <matthew.brost@intel.com>
Mon, 4 May 2026 04:05:59 +0000 (21:05 -0700)
commit84d5d76c4e8e2750fa17869b7272f189d2bdd40b
tree9b18c75d3305421fd94b1db2501a8b7719c93f98
parent01eb80b767430ae868c48ad106c60eb61a508c85
drm/ttm: Fix GPU MM stats during pool shrinking

TTM pool shrinking frees pages by calling __free_pages() directly,
which bypasses updates to NR_GPU_ACTIVE and leaves GPU MM accounting
out of sync.

Introduce a helper, __free_pages_gpu_account(), and use it for all page
frees in ttm_pool.c so GPU MM statistics are updated consistently.

Reported-by: Kenneth Crudup <kenny@panix.com>
Fixes: ae80122f3896 ("drm/ttm: use gpu mm stats to track gpu memory allocations. (v4)")
Cc: Christian Koenig <christian.koenig@amd.com>
Cc: Huang Rui <ray.huang@amd.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: David Airlie <airlied@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Tested-by: Kenneth Crudup <kenny@panix.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Link: https://patch.msgid.link/20260502065338.2720646-1-matthew.brost@intel.com
drivers/gpu/drm/ttm/ttm_pool.c