[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM9Jb+hHpeHL5OQfJ4FLT6FnWboegG0f-d7o7FEoD21APnQX3Q@mail.gmail.com>
Date: Mon, 16 Mar 2020 17:28:21 +0100
From: Pankaj Gupta <pankaj.gupta.linux@...il.com>
To: Baoquan He <bhe@...hat.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org, mhocko@...e.com,
Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...hat.com>, willy@...radead.org,
richard.weiyang@...il.com, Vlastimil Babka <vbabka@...e.cz>
Subject: Re: [PATCH v5 2/2] mm/sparse.c: allocate memmap preferring the given node
> When allocating memmap for hot added memory with the classic sparse, the
> specified 'nid' is ignored in populate_section_memmap().
>
> While in allocating memmap for the classic sparse during boot, the node
> given by 'nid' is preferred. And VMEMMAP prefers the node of 'nid' in
> both boot stage and memory hot adding. So seems no reason to not respect
> the node of 'nid' for the classic sparse when hot adding memory.
>
> Use kvmalloc_node instead to use the passed in 'nid'.
>
> Signed-off-by: Baoquan He <bhe@...hat.com>
> Acked-by: Michal Hocko <mhocko@...e.com>
> Reviewed-by: Matthew Wilcox (Oracle) <willy@...radead.org>
> ---
> mm/sparse.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/sparse.c b/mm/sparse.c
> index 3fa407d7f70a..31dcdfb55c72 100644
> --- a/mm/sparse.c
> +++ b/mm/sparse.c
> @@ -719,8 +719,8 @@ static int fill_subsection_map(unsigned long pfn, unsigned long nr_pages)
> struct page * __meminit populate_section_memmap(unsigned long pfn,
> unsigned long nr_pages, int nid, struct vmem_altmap *altmap)
> {
> - return kvmalloc(array_size(sizeof(struct page),
> - PAGES_PER_SECTION), GFP_KERNEL);
> + return kvmalloc_node(array_size(sizeof(struct page),
> + PAGES_PER_SECTION), GFP_KERNEL, nid);
> }
>
> static void depopulate_section_memmap(unsigned long pfn, unsigned long nr_pages,
> --
Acked-by: Pankaj Gupta <pankaj.gupta.linux@...il.com>
> 2.17.2
>
>
Powered by blists - more mailing lists