Mika Kuoppala
bf213ac637
drm/xe: Fix memory leak when handling pagefault vma
...
When the pagefault handling code was moved to a new file, an extra
drm_exec_init() was added to the VMA path. This call is unnecessary because
xe_validation_ctx_init() already performs a drm_exec_init(), resulting in a
memory leak reported by kmemleak.
Remove the redundant drm_exec_init() from the VMA pagefault handling code.
Fixes: fb544b8445 ("drm/xe: Implement xe_pagefault_queue_work")
Cc: Matthew Brost <matthew.brost@intel.com >
Cc: Stuart Summers <stuart.summers@intel.com >
Cc: Lucas De Marchi <lucas.demarchi@intel.com >
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Sumit Semwal <sumit.semwal@linaro.org >
Cc: "Christian König" <christian.koenig@amd.com >
Cc: intel-xe@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com >
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com >
Reviewed-by: Matthew Brost <matthew.brost@intel.com >
Signed-off-by: Matthew Brost <matthew.brost@intel.com >
Link: https://patch.msgid.link/20251120161435.3674556-1-mika.kuoppala@linux.intel.com
(cherry picked from commit 62519b77ae )
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com >
2025-12-01 10:15:57 +01:00
Matthew Brost
fb544b8445
drm/xe: Implement xe_pagefault_queue_work
...
Implement a worker that services page faults, using the same
implementation as in xe_gt_pagefault.c.
v2:
- Rebase on exhaustive eviction changes
- Include engine instance in debug prints (Stuart)
Signed-off-by: Matthew Brost <matthew.brost@intel.com >
Reviewed-by: Stuart Summers <stuart.summers@intel.com >
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com >
Tested-by: Francois Dugast <francois.dugast@intel.com >
Link: https://patch.msgid.link/20251031165416.2871503-6-matthew.brost@intel.com
2025-11-04 09:04:29 -08:00
Matthew Brost
143aa16572
drm/xe: Implement xe_pagefault_handler
...
Enqueue (copy) the input struct xe_pagefault into a queue (i.e., into a
memory buffer) and schedule a worker to service it.
Signed-off-by: Matthew Brost <matthew.brost@intel.com >
Reviewed-by: Francois Dugast <francois.dugast@intel.com >
Tested-by: Francois Dugast <francois.dugast@intel.com >
Link: https://patch.msgid.link/20251031165416.2871503-5-matthew.brost@intel.com
2025-11-04 09:04:29 -08:00
Matthew Brost
79be336d1a
drm/xe: Implement xe_pagefault_reset
...
Squash any pending faults on the GT being reset by setting the GT field
in struct xe_pagefault to NULL.
v4:
- Only do reset it page faults queues initialized (CI)
Signed-off-by: Matthew Brost <matthew.brost@intel.com >
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com >
Tested-by: Francois Dugast <francois.dugast@intel.com >
Link: https://patch.msgid.link/20251031165416.2871503-4-matthew.brost@intel.com
2025-11-04 09:04:29 -08:00
Matthew Brost
1919d1687e
drm/xe: Implement xe_pagefault_init
...
Create pagefault queues and initialize them.
v2:
- Fix kernel doc + add comment for number PF queue (Francois)
v4:
- Move init after GT init (CI, Francois)
Signed-off-by: Matthew Brost <matthew.brost@intel.com >
Reviewed-by: Francois Dugast <francois.dugast@intel.com >
Tested-by: Francois Dugast <francois.dugast@intel.com >
Link: https://patch.msgid.link/20251031165416.2871503-3-matthew.brost@intel.com
2025-11-04 09:04:26 -08:00
Matthew Brost
620a09fb0b
drm/xe: Stub out new pagefault layer
...
Stub out the new page fault layer and add kernel documentation. This is
intended as a replacement for the GT page fault layer, enabling multiple
producers to hook into a shared page fault consumer interface.
v2:
- Fix kernel doc typo (checkpatch)
- Remove comment around GT (Stuart)
- Add explaination around reclaim (Francois)
- Add comment around u8 vs enum (Francois)
- Include engine instance (Stuart)
v3:
- Fix XE_PAGEFAULT_TYPE_ATOMIC_ACCESS_VIOLATION kernel doc (Stuart)
Signed-off-by: Matthew Brost <matthew.brost@intel.com >
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com >
Tested-by: Francois Dugast <francois.dugast@intel.com >
Link: https://patch.msgid.link/20251031165416.2871503-2-matthew.brost@intel.com
2025-11-04 09:01:58 -08:00