Re: [patch v4] mm: vmstat_kunit: add synthetic benchmark for vm stats
From: Andrew Morton
Date: Sat Sep 26 2026 - 18:38:16 EST
On Fri, 18 Sep 2026 13:39:52 -0700 (PDT) David Rientjes <rientjes@xxxxxxxxxx> wrote:
> From: Christoph Lameter <cl@xxxxxxxxxx>
>
> Add a synthetic benchmark that can be used to measure performance of VM
> statistics. This is used to analyze any improvements or regressions in
> functions that are frequently used in hot code paths.
>
> The test is run by KUnit or doing modprobe vmstat_kunit directly.
>
> Sample output:
> KTAP version 1
> 1..1
> KTAP version 1
> # Subtest: vmstat
> # module: vmstat_kunit
> 1..3
> # vmstat_test_inc_dec_zone_page_state: 10000 ops: inc_zone_page_state -> 8 cycles (4 ns/op), dec_zone_page_state -> 9 cycles (4 ns/op)
> ok 1 vmstat_test_inc_dec_zone_page_state
> # vmstat_test_interleaved_zone_page_state: 10000 ops: inc/dec pair -> 17 cycles (8 ns/op)
> ok 2 vmstat_test_interleaved_zone_page_state
> # vmstat_test_count_vm_event: 10000 ops: count_vm_event -> 4 cycles (2 ns/op)
> ok 3 vmstat_test_count_vm_event
> # vmstat: pass:3 fail:0 skip:0 total:3
> # Totals: pass:3 fail:0 skip:0 total:3
> ok 1 vmstat
This hasn't generated a lot of interest.
Can you better explain the value? How do you anticipate that people
use this? What value does it offer? Sell it to us!
People could use it across kernel versions to detect performance
regressions/improvements. "kernel test robot" appears to already be
set up to track this (eg,
https://lore.kernel.org/202609230824.7a9189aa-lkp@xxxxxxxxx). Do you
anticipate that this module will be wired into such projects?
Other than that, it seems it's mainly a developer-centric thing? An
individual developer could use it to verify that a proposed vmstat
change doesn't slow things down, or that it does speed things up, if
that was the intent.
Will google use this internally, or will they do so? If so, how?