linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: page_alloc: call panic() when memoryless node allocation fails
Date: Mon, 13 Feb 2023 10:53:18 -0800	[thread overview]
Message-ID: <20230213105318.e2a83d60c12e734d45dccf1a@linux-foundation.org> (raw)
In-Reply-To: <20230212111027.95520-1-zhengqi.arch@bytedance.com>

On Sun, 12 Feb 2023 19:10:27 +0800 Qi Zheng <zhengqi.arch@bytedance.com> wrote:

> In free_area_init(), we will continue to run after pgdat of memoryless
> node allocation 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.
> 
> ...
>
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -8360,11 +8360,9 @@ void __init free_area_init(unsigned long *max_zone_pfn)
>  
>  			/* 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);

Have you actually hit this at runtime?  If so, is there something we
can do to handle this failure more gracefully?



  reply	other threads:[~2023-02-13 18:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-12 11:10 Qi Zheng
2023-02-13 18:53 ` Andrew Morton [this message]
2023-02-14  3:14   ` Qi Zheng

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=20230213105318.e2a83d60c12e734d45dccf1a@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=zhengqi.arch@bytedance.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