Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
To: "Brendan Jackman" <jackmanb@google.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Suren Baghdasaryan" <surenb@google.com>,
	"Michal Hocko" <mhocko@suse.com>,
	"Johannes Weiner" <hannes@cmpxchg.org>, "Zi Yan" <ziy@nvidia.com>,
	"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
	"Clark Williams" <clrkwllms@kernel.org>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Waiman Long" <longman@redhat.com>,
	"Ridong Chen" <ridong.chen@linux.dev>,
	"Tejun Heo" <tj@kernel.org>, "Michal Koutný" <mkoutny@suse.com>,
	"David Hildenbrand" <david@kernel.org>,
	"Lorenzo Stoakes" <ljs@kernel.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	"Mike Rapoport" <rppt@kernel.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	cgroups@vger.kernel.org, linux-rt-devel@lists.linux.dev
Subject: Re: [PATCH v3 4/4] mm/page_alloc: remove a couple of VM_BUG_ON()st
Date: Wed, 15 Jul 2026 15:25:03 +0200	[thread overview]
Message-ID: <ed4572f4-0074-45c5-993d-7b6533eddc31@kernel.org> (raw)
In-Reply-To: <20260715-spin-trylock-followup-v3-4-fc4d246f705d@google.com>

Subject has stray 't' at the end?

On 7/15/26 13:03, Brendan Jackman wrote:
> VM_BUG_ON() is out of favour and on the way to removal, since I recently
> touched alloc_pages_node_noprof() I am removing that invocation, and
> also removing the __folio_alloc_node_noprof() one for consistency. If
> this precondition is violated, the system will soon crash anyway.
> 
> Suggested-by: Zi Yan <ziy@nvidia.com>
> Link: https://lore.kernel.org/all/7F866265-3F2E-4765-B9D4-9AB898A9C4AC@nvidia.com/
> Acked-by: Zi Yan <ziy@nvidia.com>
> Signed-off-by: Brendan Jackman <jackmanb@google.com>

Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>

> ---
>  include/linux/gfp.h | 1 -
>  mm/page_alloc.c     | 1 -
>  2 files changed, 2 deletions(-)
> 
> diff --git a/include/linux/gfp.h b/include/linux/gfp.h
> index 4d57e9c0bf204..872bc53f32ec8 100644
> --- a/include/linux/gfp.h
> +++ b/include/linux/gfp.h
> @@ -255,7 +255,6 @@ static inline void warn_if_node_offline(int this_node, gfp_t gfp_mask)
>  static inline
>  struct folio *__folio_alloc_node_noprof(gfp_t gfp, unsigned int order, int nid)
>  {
> -	VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES);
>  	warn_if_node_offline(nid, gfp);
>  
>  	return __folio_alloc_noprof(gfp, order, nid, NULL);

Well if you want more cleanups, I can see in iommu_alloc_pages_node_sz():


        /*
         * __folio_alloc_node() does not handle NUMA_NO_NODE like
         * alloc_pages_node() did.
         */
        if (nid == NUMA_NO_NODE)
                nid = numa_mem_id();

        folio = __folio_alloc_node(gfp | __GFP_ZERO, order, nid);

Should we introduce folio_alloc_node() and make __folio_alloc_node()
mm-internal, for consistency?

> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 25a83a57aab66..4c6815f84adc6 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -5427,7 +5427,6 @@ struct page *alloc_pages_node_noprof(int nid, gfp_t gfp_mask, unsigned int order
>  	if (nid == NUMA_NO_NODE)
>  		nid = numa_mem_id();
>  
> -	VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES);
>  	warn_if_node_offline(nid, gfp_mask);
>  
>  	return __alloc_pages_noprof(gfp_mask, order, nid, NULL, ALLOC_DEFAULT);
> 



  reply	other threads:[~2026-07-15 13:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-15 11:03 [PATCH v3 0/4] mm/page_alloc: couple of followups for recent cleanups Brendan Jackman
2026-07-15 11:03 ` [PATCH v3 1/4] mm/page_alloc: rename FPI_TRYLOCK -> FPI_NOLOCK Brendan Jackman
2026-07-15 13:14   ` Vlastimil Babka (SUSE)
2026-07-15 11:03 ` [PATCH v3 2/4] cgroup/cpuset: update some comments about the page allocator Brendan Jackman
2026-07-15 13:16   ` Vlastimil Babka (SUSE)
2026-07-15 11:03 ` [PATCH v3 3/4] mm/page_alloc: fixup alloc_pages_nolock_noprof() comment Brendan Jackman
2026-07-15 13:17   ` Vlastimil Babka (SUSE)
2026-07-15 11:03 ` [PATCH v3 4/4] mm/page_alloc: remove a couple of VM_BUG_ON()st Brendan Jackman
2026-07-15 13:25   ` Vlastimil Babka (SUSE) [this message]
2026-07-15 13:48     ` Brendan Jackman
2026-07-15 13:56       ` Vlastimil Babka (SUSE)

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=ed4572f4-0074-45c5-993d-7b6533eddc31@kernel.org \
    --to=vbabka@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=bigeasy@linutronix.de \
    --cc=cgroups@vger.kernel.org \
    --cc=clrkwllms@kernel.org \
    --cc=david@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=jackmanb@google.com \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=ljs@kernel.org \
    --cc=longman@redhat.com \
    --cc=mhocko@suse.com \
    --cc=mkoutny@suse.com \
    --cc=ridong.chen@linux.dev \
    --cc=rostedt@goodmis.org \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=tj@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