All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-page_alloc-call-panic-when-memoryless-node-allocation-fails.patch added to mm-unstable branch
@ 2023-02-13 18:53 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2023-02-13 18:53 UTC (permalink / raw)
  To: mm-commits, zhengqi.arch, akpm


The patch titled
     Subject: mm: page_alloc: call panic() when memoryless node allocation fails
has been added to the -mm mm-unstable branch.  Its filename is
     mm-page_alloc-call-panic-when-memoryless-node-allocation-fails.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-page_alloc-call-panic-when-memoryless-node-allocation-fails.patch

This patch will later appear in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Qi Zheng <zhengqi.arch@bytedance.com>
Subject: mm: page_alloc: call panic() when memoryless node allocation fails
Date: Sun, 12 Feb 2023 19:10:27 +0800

In free_area_init(), we will continue to run after allocation of
memoryless node pgdat fails.  However, in the subsequent process (such as
when initializing zonelist), the case that NODE_DATA(nid) is NULL is not
handled, which will cause panic.  Instead of this, it's better to call
panic() directly when the memory allocation fails during system boot.

Link: https://lkml.kernel.org/r/20230212111027.95520-1-zhengqi.arch@bytedance.com
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---


--- a/mm/page_alloc.c~mm-page_alloc-call-panic-when-memoryless-node-allocation-fails
+++ a/mm/page_alloc.c
@@ -8422,11 +8422,9 @@ void __init free_area_init(unsigned long
 
 			/* Allocator not initialized yet */
 			pgdat = arch_alloc_nodedata(nid);
-			if (!pgdat) {
-				pr_err("Cannot allocate %zuB for node %d.\n",
-						sizeof(*pgdat), nid);
-				continue;
-			}
+			if (!pgdat)
+				panic("Cannot allocate %zuB for node %d.\n",
+				       sizeof(*pgdat), nid);
 			arch_refresh_nodedata(nid, pgdat);
 			free_area_init_memoryless_node(nid);
 
_

Patches currently in -mm which might be from zhengqi.arch@bytedance.com are

mm-page_alloc-call-panic-when-memoryless-node-allocation-fails.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-13 18:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-13 18:53 + mm-page_alloc-call-panic-when-memoryless-node-allocation-fails.patch added to mm-unstable branch Andrew Morton

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.