drm/xe: Add explicit abort page reclaim list

PRLs could be invalidated to indicate its getting dropped from current
scope but are still valid. So standardize calls and add abort to clearly
define when an invalidation is a real abort and PRL should fallback.

v3:
 - Update abort function to macro. (Matthew B)

Signed-off-by: Brian Nguyen <brian3.nguyen@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20260107010447.4125005-8-brian3.nguyen@intel.com
This commit is contained in:
Brian Nguyen
2026-01-07 09:04:50 +08:00
committed by Matthew Brost
parent 52cb4a595f
commit 7a0e86e3c9
2 changed files with 28 additions and 12 deletions

View File

@@ -1618,10 +1618,9 @@ static int generate_reclaim_entry(struct xe_tile *tile,
} else if (is_2m_pte(xe_child)) {
reclamation_size = COMPUTE_RECLAIM_ADDRESS_MASK(SZ_2M); /* reclamation_size = 9 */
} else {
xe_page_reclaim_list_invalidate(prl);
vm_dbg(&tile_to_xe(tile)->drm,
"PRL invalidate: unsupported PTE level=%u pte=%#llx\n",
xe_child->level, pte);
xe_page_reclaim_list_abort(tile->primary_gt, prl,
"unsupported PTE level=%u pte=%#llx",
xe_child->level, pte);
return -EINVAL;
}
@@ -1670,10 +1669,9 @@ static int xe_pt_stage_unbind_entry(struct xe_ptw *parent, pgoff_t offset,
break;
} else {
/* overflow, mark as invalid */
xe_page_reclaim_list_invalidate(xe_walk->prl);
vm_dbg(&xe->drm,
"PRL invalidate: overflow while adding pte=%#llx",
pte);
xe_page_reclaim_list_abort(xe_walk->tile->primary_gt, xe_walk->prl,
"overflow while adding pte=%#llx",
pte);
break;
}
}
@@ -1682,10 +1680,9 @@ static int xe_pt_stage_unbind_entry(struct xe_ptw *parent, pgoff_t offset,
/* If aborting page walk early, invalidate PRL since PTE may be dropped from this abort */
if (xe_pt_check_kill(addr, next, level - 1, xe_child, action, walk) &&
xe_walk->prl && level > 1 && xe_child->base.children && xe_child->num_live != 0) {
xe_page_reclaim_list_invalidate(xe_walk->prl);
vm_dbg(&xe->drm,
"PRL invalidate: kill at level=%u addr=%#llx next=%#llx num_live=%u\n",
level, addr, next, xe_child->num_live);
xe_page_reclaim_list_abort(xe_walk->tile->primary_gt, xe_walk->prl,
"kill at level=%u addr=%#llx next=%#llx num_live=%u\n",
level, addr, next, xe_child->num_live);
}
return 0;