]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: selftests: access_tracking_perf_test: Use MGLRU for access tracking
authorJames Houghton <jthoughton@google.com>
Thu, 8 May 2025 18:46:48 +0000 (18:46 +0000)
committerSean Christopherson <seanjc@google.com>
Fri, 16 May 2025 19:58:21 +0000 (12:58 -0700)
commitd166453ebd2925edde24872d9b8ac60065eb0618
tree6e14626b7c7392d8830dda7e18c4362e437e4c2c
parentb11fcb51e2b278739509637bb0705c20f9cb138a
KVM: selftests: access_tracking_perf_test: Use MGLRU for access tracking

Use MGLRU's debugfs interface to do access tracking instead of
page_idle. The logic to use the page_idle bitmap is left in, as it is
useful for kernels that do not have MGLRU built in.

When MGLRU is enabled, page_idle will report pages as still idle even
after being accessed, as MGLRU doesn't necessarily clear the Idle folio
flag when accessing an idle page, so the test will not attempt to use
page_idle if MGLRU is enabled but otherwise not usable.

Aging pages with MGLRU is much faster than marking pages as idle with
page_idle.

Co-developed-by: Axel Rasmussen <axelrasmussen@google.com>
Signed-off-by: Axel Rasmussen <axelrasmussen@google.com>
Signed-off-by: James Houghton <jthoughton@google.com>
Link: https://lore.kernel.org/r/20250508184649.2576210-8-jthoughton@google.com
[sean: print parsed features, not raw string]
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/Makefile.kvm
tools/testing/selftests/kvm/access_tracking_perf_test.c
tools/testing/selftests/kvm/include/lru_gen_util.h [new file with mode: 0644]
tools/testing/selftests/kvm/lib/lru_gen_util.c [new file with mode: 0644]