From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32FE9C43331 for ; Thu, 2 Apr 2020 04:09:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DF242206E9 for ; Thu, 2 Apr 2020 04:09:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Qmp8NCpQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF242206E9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8D2F68E006F; Thu, 2 Apr 2020 00:09:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 85AD98E000D; Thu, 2 Apr 2020 00:09:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7710C8E006F; Thu, 2 Apr 2020 00:09:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0251.hostedemail.com [216.40.44.251]) by kanga.kvack.org (Postfix) with ESMTP id 5C6FA8E000D for ; Thu, 2 Apr 2020 00:09:36 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 20F91180AD807 for ; Thu, 2 Apr 2020 04:09:36 +0000 (UTC) X-FDA: 76661585952.14.crush75_53cd1ade4ff55 X-HE-Tag: crush75_53cd1ade4ff55 X-Filterd-Recvd-Size: 3119 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Thu, 2 Apr 2020 04:09:35 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BD8D620784; Thu, 2 Apr 2020 04:09:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585800575; bh=jLThwwbjMgHTRUFa7pAQvbNFFPRKtG6GVbt6Nb6//uo=; h=Date:From:To:Subject:In-Reply-To:From; b=Qmp8NCpQvfJVBAXO++fIcrE0ggCShIu6X67GlXOC83rhdKRZC8bR7QWFp99vc5RBo Ro2CUDqWwQcnTA3NRa0axAjwM/Vfx/wf/eji5BQm9TL6Tr+uEiv6MfQG8avGyhj9/E YNbwhOU/Osg7SLedmdEqBymxpVB+2itVeQ83F8xw= Date: Wed, 01 Apr 2020 21:09:34 -0700 From: Andrew Morton To: akpm@linux-foundation.org, bhe@redhat.com, david@redhat.com, linux-mm@kvack.org, mhocko@suse.com, mm-commits@vger.kernel.org, pankaj.gupta.linux@gmail.com, richard.weiyang@gmail.com, torvalds@linux-foundation.org, willy@infradead.org Subject: [patch 111/155] mm/sparse.c: allocate memmap preferring the given node Message-ID: <20200402040934.hn3GftNoC%akpm@linux-foundation.org> In-Reply-To: <20200401210155.09e3b9742e1c6e732f5a7250@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Baoquan He Subject: 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'. Link: http://lkml.kernel.org/r/20200316125625.GH3486@MiWiFi-R3L-srv Signed-off-by: Baoquan He Acked-by: Michal Hocko Reviewed-by: Matthew Wilcox (Oracle) Acked-by: Pankaj Gupta Reviewed-by: David Hildenbrand Reviewed-by: Wei Yang Signed-off-by: Andrew Morton --- mm/sparse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/mm/sparse.c~mm-sparsec-allocate-memmap-preferring-the-given-node +++ a/mm/sparse.c @@ -664,8 +664,8 @@ static void free_map_bootmem(struct page 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, _