This series fixes some issues with access_tracking_perf_test when MGLRU or NUMA balancing are in use. With MGLRU, touching a page doesn't necessarily clear the Idle flag. This has come up in the past, and the recommendation was to use MGLRU generation numbers[1], which this series does. With NUMA balancing, pages are temporarily mapped as PROT_NONE, so the SPTEs will be zapped, losing the Accessed bits. The fix here is, in the event we have lost access information to print a warning and continue with the test, just like what we do if the test is running a nested VM. A flag is added for the user to specify if they wish for the test to always enforce or always skip this check. Based on kvm/next. Changelog: v2[3] -> v3: - Applied David's directory fix on patch 3. - Added SoB-by, R-by (patch 2, missed in v2), and A-by. v1[2] -> v2: - Re-add clone3_selftests.h for cgroup selftests (thanks Michal!) - Some comment fixes, patches 2 and 5 (thanks Maxim!). [1]: https://lore.kernel.org/all/CAOUHufZeADNp_y=Ng+acmMMgnTR=ZGFZ7z-m6O47O=CmJauWjw@xxxxxxxxxxxxxx/ [2]: https://lore.kernel.org/kvm/20250327012350.1135621-1-jthoughton@xxxxxxxxxx/ [3]: https://lore.kernel.org/kvm/20250331213025.3602082-1-jthoughton@xxxxxxxxxx/ James Houghton (3): cgroup: selftests: Move cgroup_util into its own library KVM: selftests: Build and link selftests/cgroup/lib into KVM selftests KVM: selftests: access_tracking_perf_test: Use MGLRU for access tracking Maxim Levitsky (1): KVM: selftests: access_tracking_perf_test: Add option to skip the sanity check Sean Christopherson (1): KVM: selftests: Extract guts of THP accessor to standalone sysfs helpers tools/testing/selftests/cgroup/Makefile | 21 +- .../selftests/cgroup/{ => lib}/cgroup_util.c | 2 +- .../cgroup/{ => lib/include}/cgroup_util.h | 4 +- .../testing/selftests/cgroup/lib/libcgroup.mk | 19 + tools/testing/selftests/kvm/Makefile.kvm | 4 +- .../selftests/kvm/access_tracking_perf_test.c | 263 ++++++++++-- .../selftests/kvm/include/lru_gen_util.h | 51 +++ .../testing/selftests/kvm/include/test_util.h | 1 + .../testing/selftests/kvm/lib/lru_gen_util.c | 383 ++++++++++++++++++ tools/testing/selftests/kvm/lib/test_util.c | 42 +- 10 files changed, 733 insertions(+), 57 deletions(-) rename tools/testing/selftests/cgroup/{ => lib}/cgroup_util.c (99%) rename tools/testing/selftests/cgroup/{ => lib/include}/cgroup_util.h (99%) create mode 100644 tools/testing/selftests/cgroup/lib/libcgroup.mk create mode 100644 tools/testing/selftests/kvm/include/lru_gen_util.h create mode 100644 tools/testing/selftests/kvm/lib/lru_gen_util.c base-commit: fd02aa45bda6d2f2fedcab70e828867332ef7e1c -- 2.49.0.604.gff1f9ca942-goog