Re: [patch v6] mm: vmstat_kunit: add synthetic benchmark for mm stats

From: David Hildenbrand (Arm)

Date: Sat Nov 21 2026 - 08:07:32 EST


On 11/5/26 02:53, David Rientjes wrote:
> From: Christoph Lameter <cl@xxxxxxxxxx>
>
> Add a synthetic benchmark that can be used to measure performance of MM
> statistics. This is used to analyze any improvements or regressions in
> functions that are frequently used in hot code paths.
>
> This is the first of three tests that measure the execution times of
> critical MM functions anticipated to be used by developers to measure the
> impact of any core changes that would end up causing workload performance
> issues. Vmstats are embedded into MM hotpaths, so any regression can
> cause performance and scalability impact for users. Google has carried
> these tests internally and kept them updated since Christoph posted them
> back in 2009 for this purpose.
>
> This can also be used to detect regressions over time, from kernel
> version to kernel version, independent of development use cases.
>
> 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
>
> Assisted-by: Gemini:gemini-3.8-flash
> Signed-off-by: Christoph Lameter <cl@xxxxxxxxxx>
> Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx>

Thanks!

Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>

@Andrew, can you do the honors and queue this?

--
Cheers,

David