Re: [PATCH] mm/vmstat: spread vmstat_update requeue across the stat interval
From: Matthew Wilcox
Date: Thu Apr 02 2026 - 08:50:07 EST
On Wed, Apr 01, 2026 at 06:57:50AM -0700, Breno Leitao wrote:
> vmstat_update uses round_jiffies_relative() when re-queuing itself,
> which aligns all CPUs' timers to the same second boundary. When many
> CPUs have pending PCP pages to drain, they all call decay_pcp_high() ->
> free_pcppages_bulk() simultaneously, serializing on zone->lock and
> hitting contention.
>
> Introduce vmstat_spread_delay() which distributes each CPU's
> vmstat_update evenly across the stat interval instead of aligning them.
But, uh, round_jiffies_relative() is _supposed_ to do that! Look at
both the documentation and implementation. Why isn't it working?