public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	 Suren Baghdasaryan <surenb@google.com>,
	 Brendan Jackman <jackmanb@google.com>,
	 Johannes Weiner <hannes@cmpxchg.org>, Zi Yan <ziy@nvidia.com>,
	 Petr Mladek <pmladek@suse.com>,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org
Subject: Re: [patch] mm, page_alloc: reintroduce page allocation stall warning
Date: Mon, 30 Mar 2026 15:34:14 -0700 (PDT)	[thread overview]
Message-ID: <bf25058a-4e35-8524-e8f3-97e2a1c0b815@google.com> (raw)
In-Reply-To: <fc4d2479-08f1-441e-a1ba-74fa6b50262d@kernel.org>

On Mon, 30 Mar 2026, Vlastimil Babka (SUSE) 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.
> > 
> > I think it makes sense to summarize reasons for the revert. I would
> > propose to change the above to somehting like
> > "
> > The warning was subsequently reverted in commit 400e22499dd9 ("mm: don't
> > warn about allocations which stall for too long") because it was
> > possible to generate memory pressure that would effectivelly stall
> > further progress through printk execution.
> > "
> >  

Will do!

> >> @@ -4841,6 +4884,9 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
> >>  	if (current->flags & PF_MEMALLOC)
> >>  		goto nopage;
> >>  
> >> +	/* If allocation has taken excessively long, warn about it */
> >> +	check_alloc_stall_warn(gfp_mask, ac->nodemask, order, alloc_start_time);
> >> +
> >>  	/* Try direct reclaim and then allocating */
> >>  	if (!compact_first) {
> >>  		page = __alloc_pages_direct_reclaim(gfp_mask, order, alloc_flags,
> > 
> > Is there any specific reason for this placement? Compaction can take
> > quite some time as well.
> 
> It seems fine to me - as longs as the slowpath is retrying for 10 seconds
> and still can't obtain a page, there's a warning.
> 
> We don't catch cases when either the get_page_from_freelist() attempt,
> direct compaction or direct reclaim attempt is what gets us over 10 seconds,
> and at the same time it results in success. If that's a concern, we should
> add another check_alloc_stall_warn() call under got_pg label (as the RFC
> had) - I'm not sure it's all achievable with a single place with the call.
> 

Right, the big idea here is that at least one of the allocations that is 
looping will run into the check_alloc_stall_warn().  We might miss a 
borderline case but the 10 seconds is already arbitrary and this is the 
placement where commit 63f53dea0c98 ("mm: warn about allocations which 
stall for too long") ended up before it was reverted.

  reply	other threads:[~2026-03-30 22:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-22  3:03 [RFC] mm, page_alloc: reintroduce page allocation stall warning David Rientjes
2026-03-22 20:28 ` David Rientjes
2026-03-23 14:24 ` Vlastimil Babka (SUSE)
2026-03-24  1:06   ` David Rientjes
2026-03-23 16:53 ` Michal Hocko
2026-03-24  1:13   ` David Rientjes
2026-03-24  8:05     ` Petr Mladek
2026-03-23 19:05 ` Andrew Morton
2026-03-30  1:08 ` [patch] " David Rientjes
2026-03-30  3:17   ` Andrew Morton
2026-03-30 14:06     ` Vlastimil Babka (SUSE)
2026-03-30 13:54   ` Michal Hocko
2026-03-30 15:13     ` Vlastimil Babka (SUSE)
2026-03-30 22:34       ` David Rientjes [this message]
2026-03-30 15:00   ` Vlastimil Babka (SUSE)
2026-03-30 22:42   ` [patch v2] " David Rientjes
2026-03-31  1:20     ` [patch v3] " David Rientjes
2026-03-31  3:02       ` Shakeel Butt
2026-03-31  7:54       ` Michal Hocko
     [not found]       ` <69cb3957.5d0a0220.93499.af4cSMTPIN_ADDED_BROKEN@mx.google.com>
2026-03-31 16:44         ` David Rientjes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bf25058a-4e35-8524-e8f3-97e2a1c0b815@google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=jackmanb@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=pmladek@suse.com \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=ziy@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox