]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: selftests: Precisely track number of dirty/clear pages for each iteration
authorSean Christopherson <seanjc@google.com>
Sat, 11 Jan 2025 00:29:49 +0000 (16:29 -0800)
committerSean Christopherson <seanjc@google.com>
Wed, 12 Feb 2025 17:00:55 +0000 (09:00 -0800)
commitaf2d85d34d158c4ab49e1d41c19a100ee83c148a
treec7cc35468f5c4e647eedb921c43c36bcf1362f24
parent1230907864d7cf6c280e3b6c00883e0ef7ed3319
KVM: selftests: Precisely track number of dirty/clear pages for each iteration

Track and print the number of dirty and clear pages for each iteration.
This provides parity between all log modes, and will allow collecting the
dirty ring multiple times per iteration without spamming the console.

Opportunistically drop the "Dirtied N pages" print, which is redundant
and wrong.  For the dirty ring testcase, the vCPU isn't guaranteed to
complete a loop.  And when the vCPU does complete a loot, there are no
guarantees that it has *dirtied* that many pages; because the writes are
to random address, the vCPU may have written the same page over and over,
i.e. only dirtied one page.

While the number of writes performed by the vCPU is also interesting,
e.g. the pr_info() could be tweaked to use different verbiage, pages_count
doesn't correctly track the number of writes either (because loops aren't
guaranteed to a complete).  Delete the print for now, as a future patch
will precisely track the number of writes, at which point the verification
phase can report the number of writes performed by each iteration.

Link: https://lore.kernel.org/r/20250111003004.1235645-6-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/dirty_log_test.c