RE: [PATCH 0/4] tests/xe: Add xe_page_reclaim test suite

Nguyen, Brian3
2026-04-07T22:04:09Z

On Tuesday, April 7, 2026 12:16 PM, Stuart Summers wrote:
> On Mon, 2026-04-06 at 18:42 +0000, Brian Nguyen wrote:
> > Page Reclamation is a Xe3p feature that optimizes TLB invalidations
> > by targeting only the specific physical pages being unmapped, rather
> > than
> > issuing a full PPC flush. With Page Reclamation, the driver maintains
> > a
> > Page Reclaim List (PRL), on the backing pages of a VMA range, which
> > is
> > passed into the hardware, limiting the flush to only the affected
> > pages.
> >
> > PRL supports up to 512 entries and beyond that results in a fallback
> > to
> > full TLB invalidation, and invalidating the PRL. The page reclamation
> > test
> > cases validate different combinations of the possible VMA ranges.
> >
> > The primary source of validation of these cases is derived from the
> > gt_stats in debugfs to confirm the proper PRL generation.
>
> Just a high level question here, assuming the page reclamation is
> happening at every invalidation and we should be getting coverage
> generally across many of our tests (e.g. xe_* --r *invalidation*),
> would it make sense to reduce the test scope here by just adding hooks
> to the existing tests to check counters - and this kind of
> infrastructure could potentially even go beyond just page
> reclamation...
>

The hook does sound very interesting to look into. Give me some time to think
that over. The worry is mainly about correctness of backing pages. Test control
what pages are allocated to judge the PRL generation correctness whereas
with other test cases, it may not be as clear. Most of the edge case validation
is to ensure expected pages created are added to the PRL, not necessarily
coverage for if a PRL fires off or gets invalidated.

If the hook is just checking whether a PRL fires off or gets invalidated, that
could be put in other cases, like expected TLB invalidation cases,
but I don't see how we could ensure the backing pages would remain
consistent to check. Not to mention it seems a bit nightmarish to manage
those expected values for the PRL pages across multiple tests/subtests.

> Or maybe another kind of related question, if we are adding some
> explicit invalidation sizes/alignments here, are we not covering that
> in some of the other tests like xe_vm?
>

xe_vm may have similar alignments but same issue as above, it is heavily
reliant on none of the page alignment/sizes being modified. And if it is
modified, someone must be aware to adjust the PRL hook for expected
page sizes and such. So, it feels like correctness of PRL pages are outside
the scope of most other cases.

Brian

> Thanks,
> Stuart
>
> >
> > Brian Nguyen (4):
> >   tests/xe: Add page reclaim test
> >   tests/xe: Add random page reclaim subtest
> >   tests/xe: Add transient display PRL skip
> >   tests/xe: Add large VMA range tests for better coverage
> >
> >  tests/intel/xe_page_reclaim.c | 826
> > ++++++++++++++++++++++++++++++++++
> >  tests/meson.build             |   1 +
> >  2 files changed, 827 insertions(+)
> >  create mode 100644 tests/intel/xe_page_reclaim.c
> >