All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hajime Tazaki <thehajime@gmail.com>
To: daniel@0x0f.com
Cc: joshua.hahnjy@gmail.com, akpm@linux-foundation.org,
	linux@roeck-us.net, jackmanb@google.com, hannes@cmpxchg.org,
	mhocko@suse.com, surenb@google.com, vbabka@suse.cz,
	ziy@nvidia.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	kernel-team@meta.com
Subject: Re: [PATCH v2] mm/page_alloc: Report 1 as zone_batchsize for !CONFIG_MMU
Date: Fri, 19 Dec 2025 09:51:55 -0600	[thread overview]
Message-ID: <m2fr96wjtw.wl-thehajime@gmail.com> (raw)
In-Reply-To: <CAFr9PXnK+WCOGYs_e5HiCiwxN1SdjGhmR3DOi8w0BYRqooQONA@mail.gmail.com>


Hello Daniel,

On Thu, 18 Dec 2025 06:30:42 -0600,
Daniel Palmer wrote:
> 
> Hi Joshua,
> 
> On Thu, 18 Dec 2025 at 17:32, Joshua Hahn <joshua.hahnjy@gmail.com> wrote:
> >
> > Commit 2783088ef24e ("mm/page_alloc: prevent reporting pcp->batch = 0")
> > moved the error handling (0-handling) of zone_batchsize from its
> > callers to inside the function. However, the commit left out the error
> > handling for the NOMMU case, leading to deadlocks on NOMMU systems.
> >
> > For NOMMU systems, return 1 instead of 0 for zone_batchsize, which restores
> > the previous deadlock-free behavior.
> 
> Tested this on my 68000 setup, filled the memory to cause an OOM and I
> got OOM instead of deadlock as expected.
> 
> Tested-by: Daniel Palmer <daniel@thingy.jp>
> 
> FWIW There was a BoF about NOMMU at LPC last week and I did mention to
> the people presenting that seem to be using NOMMU in real world
> applications that NOMMU was broken in mainline. I hoped they would
> have chimed in on this..

I tested with UML with nommu extension (currently out of kernel *1)
and reproduced the issue with a crafted program causing OOM.

without patch it indeed hangs up with losing console access and this
patch fixes with a proper failure message like below;

oom: page allocation failure: order:12, mode:0xcc0(GFP_KERNEL), nodemask=(null)
CPU: 0 UID: 0 PID: 32 Comm: oom Not tainted 6.18.0-12966-gc43a4f128407-dirty #223 NONE
Stack:
 60a8fb80 604a246e 603b9569 00000001
 ffffff00 604a246e 6002440d 604a1479
 60a8fbb0 6002bbb3 60556910 00000000
Call Trace:
 [<6002440d>] ? _printk+0x0/0x5b
 [<6002df89>] show_stack+0x11c/0x12b
 [<603b9569>] ? dump_stack_print_info+0x0/0x12f
 [<6002440d>] ? _printk+0x0/0x5b
 [<6002bbb3>] dump_stack_lvl+0x65/0x80
 [<6002bbec>] dump_stack+0x1e/0x20
 [<600e0c13>] warn_alloc+0x118/0x195
 [<60083ae0>] ? __mutex_trylock+0x16/0x1e
(snip)


Tested-by: Hajime Tazaki <thehajime@gmail.com>

*1 https://lore.kernel.org/all/cover.1762588860.git.thehajime@gmail.com/

-- Hajime


  parent reply	other threads:[~2025-12-19 15:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-18  8:31 [PATCH v2] mm/page_alloc: Report 1 as zone_batchsize for !CONFIG_MMU Joshua Hahn
2025-12-18 11:23 ` Vlastimil Babka
2025-12-18 12:30 ` Daniel Palmer
2025-12-18 15:39   ` Guenter Roeck
2025-12-19 15:51   ` Hajime Tazaki [this message]
2025-12-18 15:39 ` Guenter Roeck
2025-12-20  2:41 ` SeongJae Park

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=m2fr96wjtw.wl-thehajime@gmail.com \
    --to=thehajime@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=daniel@0x0f.com \
    --cc=hannes@cmpxchg.org \
    --cc=jackmanb@google.com \
    --cc=joshua.hahnjy@gmail.com \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@roeck-us.net \
    --cc=mhocko@suse.com \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.