]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/xe/bo: Add purgeable shrinker state helpers
authorArvind Yadav <arvind.yadav@intel.com>
Thu, 26 Mar 2026 13:08:36 +0000 (18:38 +0530)
committerMatthew Brost <matthew.brost@intel.com>
Fri, 27 Mar 2026 02:59:53 +0000 (19:59 -0700)
commit536a2ead3a8f2048643da3e8340a4d73fdf71903
treee4c229786a2037fa6679027567ee074954e8f65a
parentda857c9a48874dff183a10348ab1a49ffba1ec1e
drm/xe/bo: Add purgeable shrinker state helpers

Encapsulate TTM purgeable flag updates and shrinker page accounting
into helper functions to prevent desynchronization between the TTM
tt->purgeable flag and the shrinker's page bucket counters.

Without these helpers, direct manipulation of xe_ttm_tt->purgeable
risks forgetting to update the corresponding shrinker counters,
leading to incorrect memory pressure calculations.

Update purgeable BO state to PURGED after successful shrinker purge
for DONTNEED BOs.

Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: Arvind Yadav <arvind.yadav@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20260326130843.3545241-11-arvind.yadav@intel.com
drivers/gpu/drm/xe/xe_bo.c