lkml.org 
[lkml]   [2021]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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?

\
 
 \ /
  Last update: 2021-11-01 21:41    [W:0.135 / U:0.976 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site