From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7C2835E55C for ; Fri, 19 Dec 2025 15:51:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766159525; cv=none; b=C0WYsHQEXMFY61hUNgaf8j4cGcikrDqixCwi+vzJyzwoIhEVZGDoCYEdsg92FcqlwR7CFduNXs29UBFOAN1VLUQX10k/0DL7OI6pamuboIytQP+Ngxa4Oo3jwi0Gwtni0XV5qr3XJfDBx/7HVJ2rlg2cf5c1ysNwZgbLJTgVF1Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766159525; c=relaxed/simple; bh=h4cUPn0xUwZk/pLJg5kaXBPU+T8hKoNz+OF+fw9n/gI=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=i5XgLQ/GVxjYPNNCJKueZa7QrE321qdJteQQYDXurSy/fKeY8WFbvOMZ7joZWSmsI5VP5oAp0aCizwAO6ezTppKo+nmXs1JEikgcDoTRJaOXkRJ21flKAuHh3tzQ11XG994yIoQcEg7aIlbVl7Ke0hSBJ1fvIT+nI98dT8QZdas= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YA0AeseG; arc=none smtp.client-ip=209.85.160.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YA0AeseG" Received: by mail-qt1-f172.google.com with SMTP id d75a77b69052e-4ee05b2b1beso17804361cf.2 for ; Fri, 19 Dec 2025 07:51:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766159519; x=1766764319; darn=vger.kernel.org; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:from:to:cc:subject:date:message-id:reply-to; bh=Z0WQJhwCQ32X+kFsVdaZCrIfidsg4gOtJ/PUF04u7no=; b=YA0AeseGdWhENmMocfQkJgjp5oxI2vhRWSOh6DY7qm5fQf4crLJ35eQeoAsG/Y6U0B VZali0GPDK/248GvvUMUrNQ5aOZekbQzdZTRA99DOKq1S5weW7FuECyoejaw8npt7CJg HoigtRM/0k6faORySHVZTXYiMUXpWSySNPmEtgfqdzKdWupdsyZfFNnYuRI6DPZ/5/Oo rI/tm/OMwH4mT0Ogub5KMSFcr9c2EhD/UST2Doweiwu/WC17gK7llYw8HX9fjF367cRQ dCdBu07Cwth/TQVYIeOKZUIB3ilDR06zNftQZb6NSK/3OM5JqMc9f315ZFK78vN9ZJ8U 9a3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766159519; x=1766764319; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Z0WQJhwCQ32X+kFsVdaZCrIfidsg4gOtJ/PUF04u7no=; b=cLI0xbsPD+sGs5fGglz8G+xzOHFPIGuumxazj4oCW6GdNlTXRR0aYgx5h208eXrMO7 As+6Q7gRX2Uzzgom0mlFym+xcwHSQ0IETturewrbkBrYDUGagdOidVal9jnWEOt95J9s Vj6+7j+4Cj7CbbcjTsAVhrVQYWWDvC3SVg/wgevWgRY97P4Az01Khts5sQxpX0OXqTvj nj1JBQYw0myUyDNVKrew09JfMqUUFp8GQwXBoX/Go45X4JpZc6k7X4iYDgCHPhgLllRn vI3fG49Zwh+F5v/7dwnNT1FxQG+tp5tNvaXd9L3oy14AgdacS7tUEOFroqsf0bH35PIZ q83g== X-Forwarded-Encrypted: i=1; AJvYcCWkYi/Qg8navB2dabUYv8ooDVbEl8L86n7kGUTuTcU6ffM2a9VeJEXOYostTIUTPVN/1u4tr5z0lUrMcLY=@vger.kernel.org X-Gm-Message-State: AOJu0YxxCHl1aMvrk+ChC6aB3xhNGHjWrcJYL+Xw9bjY5vYmG8SRe/lH RPT+dRMJmkvcuR3iJQuaCiTCWe5TGvfAv9pS0DcquPRMUr4BGo4UqjsR X-Gm-Gg: AY/fxX5/0jMZgJQ8jL9h5m5gJBwo9Aq0Y//hW958CAjc1W8rhk/Qmm57mx3pEfey3rC lLSw8+70ZqaGdqIjxqjWGPwLPLWY9mlflk3CpZ18/vTJIwRHnJKUbfBjrfB2CdDU7LtBs6L19H2 VyI+Y5Z2EtuRMYNKXufqvrpJYB1AmecDirjzfBnNggeW70s5jLnV+8NR+eD26YEhcpsQENqn0YA 8lL6KVbOG6lk8hNabtQwYb2FNc7du7sHY/AL8f96lrhXrSo6K1C+XAMR6i7drQHvBZwsbkd4QPY kZizopCwoDEOss88e1pn8oCo30/lgFvTVe9sbD0Ku3nLirFV424/Pg55c9ZeRDrLA/ezfsNpXh7 ajlDsinv+462wg0i2ZlVsE03Z13mUcxMrdQpbq49bUhkF2ZDexGMYLcGAxfk14QrcW6+S/1dbO6 fjeVfgjNRdHjiSuXc78CIqL+5uVbcuGmygUyw6kA/SuyhcJqPAv4QHKGEQyQ/TM30zF9VRn8w7N Cq/K1i6b5q6tv8VS8KXzODv0iPjXBcizw== X-Google-Smtp-Source: AGHT+IEYnVJQIdA6P1lt+9Y51yCVFjarKMoX4NYninUuImu/Y7sCH2WJg2qbEVwoanYmzFQweqf2jg== X-Received: by 2002:ac8:588f:0:b0:4ee:4a3a:bd12 with SMTP id d75a77b69052e-4f4abdb6906mr48012841cf.57.1766159518540; Fri, 19 Dec 2025 07:51:58 -0800 (PST) Received: from mars.local.gmail.com (dhcp-129-59-122-134.n1.vanderbilt.edu. [129.59.122.134]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4f4ac62fa56sm21392181cf.17.2025.12.19.07.51.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Dec 2025 07:51:57 -0800 (PST) Date: Fri, 19 Dec 2025 09:51:55 -0600 Message-ID: From: Hajime Tazaki 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 In-Reply-To: References: <20251218083200.2435789-1-joshua.hahnjy@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/26.3 Mule/6.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII 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 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 > > 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 *1 https://lore.kernel.org/all/cover.1762588860.git.thehajime@gmail.com/ -- Hajime