Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/10] Page Reclamation Support for Xe3p Platforms
@ 2025-12-09 20:08 Brian Nguyen
  2025-12-09 20:08 ` [PATCH v4 01/10] drm/xe: Do not forward invalid TLB invalidation seqnos to upper layers Brian Nguyen
                   ` (9 more replies)
  0 siblings, 10 replies; 13+ messages in thread
From: Brian Nguyen @ 2025-12-09 20:08 UTC (permalink / raw)
  To: intel-xe; +Cc: tejas.upadhyay, matthew.brost, shuicheng.lin, stuart.summers

  This series introduces a hardware-assisted page reclamation support on Xe3p
platforms, integrating with the KMD's existing TLB invalidation workflow and
adding the ability to perform selective Private Physical Cache (PPC) flushing
rather than always forcing the default full PPC flush.

Currently as of Xe2, Xe TLB invalidations trigger a full Private Physical Cache
flush to guarantee non-coherent memory correctness. New HW (Xe3p and beyond)
supports a page reclamation feature, which we selectively enable on platforms
with a flag in device info.

The driver can provide a “Page Reclaim List” (PRL), tracking the physical pages
used that correspond to an unmap/unbind operation and let hardware perform selective
cache line eviction. If reclamation succeeds, we skip the full PPC flush entirely
otherwise we fall back to our current process of full PPC flush with the TLB
invalidation.

Thanks,
Brian

v2:
 - General refactor to remove additional variables from
   tlb fences (flush_cache and PRL ptr). (Matthew B)
 - Removed lock from xe_tlb_inval_reset_timeout and moved 
   into xe_tlb_inval_done_handler. (Matthew B)
 - Removed page reclaim variables out of tlb fences (Matthew B)
 - Add FW check for page reclaim support. (Shuicheng, Matthew B)
 - Moved PRL max entries overflow handling out from
   generate_reclaim_entry to caller. (Shuicheng)
 - Fix one off error with NULL terminated PRL.
 - Add xe_page_reclaim_list_init for clarity. (Matthew B)
 - Invalidate PRL on early abort page walks.
 - Allocate PRL bo size to num_entries. (Matthew B)
 - Move PRL bo allocation to tlb_inval run_job. (Matthew B)
 - Modify debugfs to expose file only if page reclaim supported by
   default instead of previous behavior to return an ENODEV
   and thus no need to move xe_match_desc from configfs (Michal)
 - Compacted warning checking, update commit message,
   spelling, moved variables, etc. (Shuicheng, Matthew B, Michal)
 - Remove unused function. (Shuicheng)
 - Fix various missing kernel doc input.

v3:
 - Removed MEDIA_IS_ON due to racy condition. (Matthew A)
 - Move l3 policy access to xe_pat. (Matthew A)
 - Add vm_dbg prints for PRL generation and invalidation. (Matthew B)
 - Add comments for PRL tile handling and flush behavior with medai. (Matthew B)
 - Modify reclaim_entry to QW and adjust bitfields accordingly. (Matthew B)
 - Add missing shift of PTE for page address in reclaim entry. (Matthew B)
 - Fix NULL pointer dereference check.
 - s/ifence/fence for kernel doc.
 - Squashed dependent patch.
 - Update erroneous comments

v4:
 - s/GEN_MASK/GEN_MASK_ULL, s/BIT/BIT_ULL for xe_guc_reclaim_entry (CI)
 - Revised comments to current changes (Tejas)
 - Moved PAT macros back to original place.

Suggested-by: Matthew Brost <matthew.brost@intel.com>

Brian Nguyen (8):
  drm/xe/xe_tlb_inval: Modify fence interface to support PPC flush
  drm/xe/guc: Add page reclamation interface to GuC
  drm/xe: Create page reclaim list on unbind
  drm/xe: Suballocate BO for page reclaim
  drm/xe: Prep page reclaim in tlb inval job
  drm/xe: Append page reclamation action to tlb inval
  drm/xe: Optimize flushing of L2$ by skipping unnecessary page reclaim
  drm/xe: Add debugfs support for page reclamation

Matthew Brost (1):
  drm/xe: Do not forward invalid TLB invalidation seqnos to upper layers

Oak Zeng (1):
  drm/xe: Add page reclamation info to device info

 drivers/gpu/drm/xe/Makefile              |   1 +
 drivers/gpu/drm/xe/abi/guc_actions_abi.h |   2 +
 drivers/gpu/drm/xe/regs/xe_gtt_defs.h    |   1 +
 drivers/gpu/drm/xe/xe_debugfs.c          |  41 +++++++
 drivers/gpu/drm/xe/xe_device_types.h     |   9 ++
 drivers/gpu/drm/xe/xe_guc.c              |   4 +
 drivers/gpu/drm/xe/xe_guc_ct.c           |  17 +++
 drivers/gpu/drm/xe/xe_guc_fwif.h         |   1 +
 drivers/gpu/drm/xe/xe_guc_tlb_inval.c    |  37 ++++--
 drivers/gpu/drm/xe/xe_page_reclaim.c     | 133 ++++++++++++++++++++++
 drivers/gpu/drm/xe/xe_page_reclaim.h     |  81 ++++++++++++++
 drivers/gpu/drm/xe/xe_pat.c              |   8 ++
 drivers/gpu/drm/xe/xe_pat.h              |  10 ++
 drivers/gpu/drm/xe/xe_pci.c              |   1 +
 drivers/gpu/drm/xe/xe_pci_types.h        |   1 +
 drivers/gpu/drm/xe/xe_pt.c               | 137 ++++++++++++++++++++++-
 drivers/gpu/drm/xe/xe_pt_types.h         |   5 +
 drivers/gpu/drm/xe/xe_tile.c             |   5 +
 drivers/gpu/drm/xe/xe_tlb_inval.c        |  27 ++++-
 drivers/gpu/drm/xe/xe_tlb_inval.h        |   2 +-
 drivers/gpu/drm/xe/xe_tlb_inval_job.c    |  37 +++++-
 drivers/gpu/drm/xe/xe_tlb_inval_job.h    |   4 +
 drivers/gpu/drm/xe/xe_tlb_inval_types.h  |   5 +-
 drivers/gpu/drm/xe/xe_vm.c               |   4 +-
 24 files changed, 557 insertions(+), 16 deletions(-)
 create mode 100644 drivers/gpu/drm/xe/xe_page_reclaim.c
 create mode 100644 drivers/gpu/drm/xe/xe_page_reclaim.h

-- 
2.52.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-12-10  1:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-09 20:08 [PATCH v4 00/10] Page Reclamation Support for Xe3p Platforms Brian Nguyen
2025-12-09 20:08 ` [PATCH v4 01/10] drm/xe: Do not forward invalid TLB invalidation seqnos to upper layers Brian Nguyen
2025-12-09 20:08 ` [PATCH v4 02/10] drm/xe/xe_tlb_inval: Modify fence interface to support PPC flush Brian Nguyen
2025-12-09 20:08 ` [PATCH v4 03/10] drm/xe: Add page reclamation info to device info Brian Nguyen
2025-12-09 20:08 ` [PATCH v4 04/10] drm/xe/guc: Add page reclamation interface to GuC Brian Nguyen
2025-12-09 20:08 ` [PATCH v4 05/10] drm/xe: Create page reclaim list on unbind Brian Nguyen
2025-12-09 20:08 ` [PATCH v4 06/10] drm/xe: Suballocate BO for page reclaim Brian Nguyen
2025-12-09 20:08 ` [PATCH v4 07/10] drm/xe: Prep page reclaim in tlb inval job Brian Nguyen
2025-12-09 20:32   ` Matthew Brost
2025-12-10  1:00     ` Nguyen, Brian3
2025-12-09 20:08 ` [PATCH v4 08/10] drm/xe: Append page reclamation action to tlb inval Brian Nguyen
2025-12-09 20:08 ` [PATCH v4 09/10] drm/xe: Optimize flushing of L2$ by skipping unnecessary page reclaim Brian Nguyen
2025-12-09 20:08 ` [PATCH v4 10/10] drm/xe: Add debugfs support for page reclamation Brian Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox