Re: [RFC] mm, page_alloc: reintroduce page allocation stall warning

From: David Rientjes

Date: Mon Mar 23 2026 - 21:19:00 EST


On Mon, 23 Mar 2026, Michal Hocko wrote:

> On Sat 21-03-26 20:03:16, David Rientjes wrote:
> > Previously, we had warnings when a single page allocation took longer
> > than reasonably expected. This was introduced in commit 63f53dea0c98
> > ("mm: warn about allocations which stall for too long").
> >
> > The warning was subsequently reverted in commit 400e22499dd9 ("mm: don't
> > warn about allocations which stall for too long") but for reasons
> > unrelated to the warning itself.
> >
> > Page allocation stalls in excess of 10 seconds are always useful to debug
> > because they can result in severe userspace unresponsiveness. Adding
> > this artifact can be used to correlate with userspace going out to lunch
> > and to understand the state of memory at the time.
> >
> > There should be a reasonable expectation that this warning will never
> > trigger given it is very passive, it starts with a 10 second floor to
> > begin with. If it does trigger, this reveals an issue that should be
> > fixed: a single page allocation should never loop for more than 10
> > seconds without oom killing to make memory available.
> >
> > Unlike the original implementation, this implementation only reports
> > stalls that are at least a second longer than the longest stall reported
> > thus far.
>
> Am all for reintroducing the warning in some shape. The biggest problem
> back then was printk being too eager to stomp all the work at a single
> executing context. Not sure this is still the case. Let's add printk
> maintainers.

Thanks.

> Also it makes some sense to differentiate stalled callers and show_mem
> which is more verbose. The former tells us who is affected and the
> second will give us more context and we want to get some information
> about all of them. The latter can be printed much less often as it will
> describe situation for a batch of concurrent ones.
>

Based on Vlastimil's suggestion I think this is trending in the direction
of 10-second reporting windows system wide unless that doesn't work for
some reason. I do worry about reporting many stalls even without
show_mem(), however. In situations where the allocations are
unconstained, all userspace goes out to lunch for 10 seconds and that can
result in thousands of threads all reporting stalls and spamming the
kernel log.

Idea is a 10 second threshold for reporting stalls and then only one stall
report across a 10 second sliding window globally.