[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YYBQOiuq6WHMjOYf@casper.infradead.org>
Date: Mon, 1 Nov 2021 20:38:18 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Alexey Makhalov <amakhalov@...are.com>
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] mm: fix panic in __alloc_pages
On Mon, Nov 01, 2021 at 01:13:12PM -0700, Alexey Makhalov wrote:
> +++ b/include/linux/gfp.h
> @@ -551,7 +551,8 @@ alloc_pages_bulk_array(gfp_t gfp, unsigned long nr_pages, struct page **page_arr
> static inline unsigned long
> alloc_pages_bulk_array_node(gfp_t gfp, int nid, unsigned long nr_pages, struct page **page_array)
> {
> - if (nid == NUMA_NO_NODE)
> + if (nid == NUMA_NO_NODE || (!node_online(nid) &&
> + !(gfp & __GFP_THISNODE)))
> nid = numa_mem_id();
>
> return __alloc_pages_bulk(gfp, nid, NULL, nr_pages, NULL, page_array);
I don't think it's a great idea to push node_online() and the gfp check
into the caller. Can't we put this check in __alloc_pages_bulk() instead?
Powered by blists - more mailing lists