diff options
| author | Arvind Yadav <arvind.yadav@intel.com> | 2026-03-26 18:38:32 +0530 |
|---|---|---|
| committer | Matthew Brost <matthew.brost@intel.com> | 2026-03-26 19:59:53 -0700 |
| commit | 5bfb7e6a7fc0056a974ce13a81c95602a2cae859 (patch) | |
| tree | 8a38d2b60c02996275066007d8a62923ff0cb3a0 /include/linux/i2c/git@git.tavy.me:linux-stable.git | |
| parent | 4f44961eab8474a47de419113e1d46095f9b44e0 (diff) | |
drm/xe/madvise: Implement per-VMA purgeable state tracking
Track purgeable state per-VMA instead of using a coarse shared
BO check. This prevents purging shared BOs until all VMAs across
all VMs are marked DONTNEED.
Add xe_bo_all_vmas_dontneed() to check all VMAs before marking
a BO purgeable. Add xe_bo_recheck_purgeable_on_vma_unbind() to
handle state transitions when VMAs are destroyed - if all
remaining VMAs are DONTNEED the BO can become purgeable, or if
no VMAs remain it transitions to WILLNEED.
The per-VMA purgeable_state field stores the madvise hint for
each mapping. Shared BOs can only be purged when all VMAs
unanimously indicate DONTNEED.
This prevents the bug where unmapping the last VMA would incorrectly
flip a DONTNEED BO back to WILLNEED. The enum-based state check
preserves BO state when no VMAs remain, only updating when VMAs provide
explicit hints.
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-7-arvind.yadav@intel.com
Diffstat (limited to 'include/linux/i2c/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions
