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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC2BBC433F5 for ; Wed, 29 Sep 2021 16:25:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B12F261406 for ; Wed, 29 Sep 2021 16:25:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345846AbhI2Q1h (ORCPT ); Wed, 29 Sep 2021 12:27:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:33902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344369AbhI2Q1f (ORCPT ); Wed, 29 Sep 2021 12:27:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DDFC0613DA; Wed, 29 Sep 2021 16:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632932754; bh=b7aXVtWDEhBwy2P18vrMrRF5vEkOcm4B2QGIqZNpl+w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Qk3fNFiVM0LLD7Dfvhk908wCILib2KwdWHb6LWeyGCbjzooMsw7QJVCSHjaWHdq// 5kzky/HezfRR3Dbwe3iisK424Y+rxpd5cUI08UqhQ0wByhslFKsTThh+yH1Yge5WZL spvcN/gWeJSg5+ysBG1TQ/WRvRz9n9hGu7PlAuDNWekfQoTtFnsIbLjqqLLI/HIPQU HZIL15iKajwXsrB3CX/XNKR06k7seOS0yovpsfr+ASBhkvfOGjz2qYQI5R3AITj1Gw jY3KU1Y4U6CjkhQUqBSWoMcABVTz+fFUeky+UBY8FPQnZn6Z/KlQi36nqmpc1Ecly7 AxNSDgIu1M+Ew== Date: Wed, 29 Sep 2021 09:25:52 -0700 From: Mike Rapoport To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, Andrew Morton , Michal Hocko , Oscar Salvador , Jianyong Wu , "Aneesh Kumar K . V" , Vineet Gupta , Geert Uytterhoeven , Huacai Chen , Jiaxun Yang , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Eric Biederman , Arnd Bergmann , linux-snps-arc@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, linux-mm@kvack.org, kexec@lists.infradead.org Subject: Re: [PATCH v1 2/4] memblock: allow to specify flags with memblock_add_node() Message-ID: References: <20210927150518.8607-1-david@redhat.com> <20210927150518.8607-3-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210927150518.8607-3-david@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 27, 2021 at 05:05:16PM +0200, David Hildenbrand wrote: > We want to specify flags when hotplugging memory. Let's prepare to pass > flags to memblock_add_node() by adjusting all existing users. > > Note that when hotplugging memory the system is already up and running > and we don't want to add the memory first and apply flags later: it > should happen within one memblock call. Why is it important that the system is up and why it should happen in a single call? I don't mind adding flags parameter to memblock_add_node() but this changelog does not really explain the reasons to do it. > Signed-off-by: David Hildenbrand > --- > arch/arc/mm/init.c | 4 ++-- > arch/ia64/mm/contig.c | 2 +- > arch/ia64/mm/init.c | 2 +- > arch/m68k/mm/mcfmmu.c | 3 ++- > arch/m68k/mm/motorola.c | 6 ++++-- > arch/mips/loongson64/init.c | 4 +++- > arch/mips/sgi-ip27/ip27-memory.c | 3 ++- > arch/s390/kernel/setup.c | 3 ++- > include/linux/memblock.h | 3 ++- > include/linux/mm.h | 2 +- > mm/memblock.c | 9 +++++---- > mm/memory_hotplug.c | 2 +- > 12 files changed, 26 insertions(+), 17 deletions(-) > > diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c > index 699ecf119641..110eb69e9bee 100644 > --- a/arch/arc/mm/init.c > +++ b/arch/arc/mm/init.c > @@ -59,13 +59,13 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size) > > low_mem_sz = size; > in_use = 1; > - memblock_add_node(base, size, 0); > + memblock_add_node(base, size, 0, MEMBLOCK_NONE); > } else { > #ifdef CONFIG_HIGHMEM > high_mem_start = base; > high_mem_sz = size; > in_use = 1; > - memblock_add_node(base, size, 1); > + memblock_add_node(base, size, 1, MEMBLOCK_NONE); > memblock_reserve(base, size); > #endif > } > diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c > index 42e025cfbd08..24901d809301 100644 > --- a/arch/ia64/mm/contig.c > +++ b/arch/ia64/mm/contig.c > @@ -153,7 +153,7 @@ find_memory (void) > efi_memmap_walk(find_max_min_low_pfn, NULL); > max_pfn = max_low_pfn; > > - memblock_add_node(0, PFN_PHYS(max_low_pfn), 0); > + memblock_add_node(0, PFN_PHYS(max_low_pfn), 0, MEMBLOCK_NONE); > > find_initrd(); > > diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c > index 5c6da8d83c1a..5d165607bf35 100644 > --- a/arch/ia64/mm/init.c > +++ b/arch/ia64/mm/init.c > @@ -378,7 +378,7 @@ int __init register_active_ranges(u64 start, u64 len, int nid) > #endif > > if (start < end) > - memblock_add_node(__pa(start), end - start, nid); > + memblock_add_node(__pa(start), end - start, nid, MEMBLOCK_NONE); > return 0; > } > > diff --git a/arch/m68k/mm/mcfmmu.c b/arch/m68k/mm/mcfmmu.c > index eac9dde65193..6f1f25125294 100644 > --- a/arch/m68k/mm/mcfmmu.c > +++ b/arch/m68k/mm/mcfmmu.c > @@ -174,7 +174,8 @@ void __init cf_bootmem_alloc(void) > m68k_memory[0].addr = _rambase; > m68k_memory[0].size = _ramend - _rambase; > > - memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0); > + memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0, > + MEMBLOCK_NONE); > > /* compute total pages in system */ > num_pages = PFN_DOWN(_ramend - _rambase); > diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c > index 3a653f0a4188..e80c5d7e6728 100644 > --- a/arch/m68k/mm/motorola.c > +++ b/arch/m68k/mm/motorola.c > @@ -410,7 +410,8 @@ void __init paging_init(void) > > min_addr = m68k_memory[0].addr; > max_addr = min_addr + m68k_memory[0].size; > - memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0); > + memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0, > + MEMBLOCK_NONE); > for (i = 1; i < m68k_num_memory;) { > if (m68k_memory[i].addr < min_addr) { > printk("Ignoring memory chunk at 0x%lx:0x%lx before the first chunk\n", > @@ -421,7 +422,8 @@ void __init paging_init(void) > (m68k_num_memory - i) * sizeof(struct m68k_mem_info)); > continue; > } > - memblock_add_node(m68k_memory[i].addr, m68k_memory[i].size, i); > + memblock_add_node(m68k_memory[i].addr, m68k_memory[i].size, i, > + MEMBLOCK_NONE); > addr = m68k_memory[i].addr + m68k_memory[i].size; > if (addr > max_addr) > max_addr = addr; > diff --git a/arch/mips/loongson64/init.c b/arch/mips/loongson64/init.c > index 76e0a9636a0e..4ac5ba80bbf6 100644 > --- a/arch/mips/loongson64/init.c > +++ b/arch/mips/loongson64/init.c > @@ -77,7 +77,9 @@ void __init szmem(unsigned int node) > (u32)node_id, mem_type, mem_start, mem_size); > pr_info(" start_pfn:0x%llx, end_pfn:0x%llx, num_physpages:0x%lx\n", > start_pfn, end_pfn, num_physpages); > - memblock_add_node(PFN_PHYS(start_pfn), PFN_PHYS(node_psize), node); > + memblock_add_node(PFN_PHYS(start_pfn), > + PFN_PHYS(node_psize), node, > + MEMBLOCK_NONE); > break; > case SYSTEM_RAM_RESERVED: > pr_info("Node%d: mem_type:%d, mem_start:0x%llx, mem_size:0x%llx MB\n", > diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c > index 6173684b5aaa..adc2faeecf7c 100644 > --- a/arch/mips/sgi-ip27/ip27-memory.c > +++ b/arch/mips/sgi-ip27/ip27-memory.c > @@ -341,7 +341,8 @@ static void __init szmem(void) > continue; > } > memblock_add_node(PFN_PHYS(slot_getbasepfn(node, slot)), > - PFN_PHYS(slot_psize), node); > + PFN_PHYS(slot_psize), node, > + MEMBLOCK_NONE); > } > } > } > diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c > index 67e5fff96ee0..f3943f15af6e 100644 > --- a/arch/s390/kernel/setup.c > +++ b/arch/s390/kernel/setup.c > @@ -593,7 +593,8 @@ static void __init setup_resources(void) > * part of the System RAM resource. > */ > if (crashk_res.end) { > - memblock_add_node(crashk_res.start, resource_size(&crashk_res), 0); > + memblock_add_node(crashk_res.start, resource_size(&crashk_res), > + 0, MEMBLOCK_NONE); > memblock_reserve(crashk_res.start, resource_size(&crashk_res)); > insert_resource(&iomem_resource, &crashk_res); > } > diff --git a/include/linux/memblock.h b/include/linux/memblock.h > index 34de69b3b8ba..b49a58f621bc 100644 > --- a/include/linux/memblock.h > +++ b/include/linux/memblock.h > @@ -100,7 +100,8 @@ static inline void memblock_discard(void) {} > #endif > > void memblock_allow_resize(void); > -int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid); > +int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid, > + enum memblock_flags flags); > int memblock_add(phys_addr_t base, phys_addr_t size); > int memblock_remove(phys_addr_t base, phys_addr_t size); > int memblock_free(phys_addr_t base, phys_addr_t size); > diff --git a/include/linux/mm.h b/include/linux/mm.h > index 73a52aba448f..0117cb35b212 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -2447,7 +2447,7 @@ static inline unsigned long get_num_physpages(void) > * unsigned long max_zone_pfns[MAX_NR_ZONES] = {max_dma, max_normal_pfn, > * max_highmem_pfn}; > * for_each_valid_physical_page_range() > - * memblock_add_node(base, size, nid) > + * memblock_add_node(base, size, nid, MEMBLOCK_NONE) > * free_area_init(max_zone_pfns); > */ > void free_area_init(unsigned long *max_zone_pfn); > diff --git a/mm/memblock.c b/mm/memblock.c > index 184dcd2e5d99..47a56b223141 100644 > --- a/mm/memblock.c > +++ b/mm/memblock.c > @@ -655,6 +655,7 @@ static int __init_memblock memblock_add_range(struct memblock_type *type, > * @base: base address of the new region > * @size: size of the new region > * @nid: nid of the new region > + * @flags: flags of the new region > * > * Add new memblock region [@base, @base + @size) to the "memory" > * type. See memblock_add_range() description for mode details > @@ -663,14 +664,14 @@ static int __init_memblock memblock_add_range(struct memblock_type *type, > * 0 on success, -errno on failure. > */ > int __init_memblock memblock_add_node(phys_addr_t base, phys_addr_t size, > - int nid) > + int nid, enum memblock_flags flags) > { > phys_addr_t end = base + size - 1; > > - memblock_dbg("%s: [%pa-%pa] nid=%d %pS\n", __func__, > - &base, &end, nid, (void *)_RET_IP_); > + memblock_dbg("%s: [%pa-%pa] nid=%d flags=%x %pS\n", __func__, > + &base, &end, nid, flags, (void *)_RET_IP_); > > - return memblock_add_range(&memblock.memory, base, size, nid, 0); > + return memblock_add_range(&memblock.memory, base, size, nid, flags); > } > > /** > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > index 917b3528636d..5f873e7f5b29 100644 > --- a/mm/memory_hotplug.c > +++ b/mm/memory_hotplug.c > @@ -1385,7 +1385,7 @@ int __ref add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags) > mem_hotplug_begin(); > > if (IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK)) { > - ret = memblock_add_node(start, size, nid); > + ret = memblock_add_node(start, size, nid, MEMBLOCK_NONE); > if (ret) > goto error_mem_hotplug_end; > } > -- > 2.31.1 > -- Sincerely yours, Mike. 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 329F4C433FE for ; Wed, 29 Sep 2021 16:26:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C1CBA61502 for ; Wed, 29 Sep 2021 16:25:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C1CBA61502 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2A5vzgvxaI1c2cFJT0cCdhvxl5MpyjfSMNF+1DR69BE=; b=u3siB7guTp3s5g YKZuhcWV3PbxcvjGIl8MNGAfKsHoMxaEFsPGqx7wtWnWTVm12PK/cMA/8yi/WSwyXYBGcjqR+BrAK i/Zzvbg0Npu22QF5qGClZTb7h1/0Un1onzETE1Ec1EkT1Zxgab5VV4AvSIR8+C12TvHZ/NzIA+2Me PMdkH0sxXgbkvu+ubLNnWavpoaCSCcqeHCVwdJcj3GNdkDmx9vugLBT4so+utPI1xHrwtWbC/wOaI YVu0xeJESOA73vfFTB+B9zV8bnBilCtCSx0lF8k3M9ETBJXI6/fpJ9/Y1BwZav7qCfHroOkeAWdAj /YfsA7K2douDUiWFfVAQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVcP9-00Bo2h-BS; Wed, 29 Sep 2021 16:25:59 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVcP4-00Bo0m-FI; Wed, 29 Sep 2021 16:25:56 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id DDFC0613DA; Wed, 29 Sep 2021 16:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632932754; bh=b7aXVtWDEhBwy2P18vrMrRF5vEkOcm4B2QGIqZNpl+w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Qk3fNFiVM0LLD7Dfvhk908wCILib2KwdWHb6LWeyGCbjzooMsw7QJVCSHjaWHdq// 5kzky/HezfRR3Dbwe3iisK424Y+rxpd5cUI08UqhQ0wByhslFKsTThh+yH1Yge5WZL spvcN/gWeJSg5+ysBG1TQ/WRvRz9n9hGu7PlAuDNWekfQoTtFnsIbLjqqLLI/HIPQU HZIL15iKajwXsrB3CX/XNKR06k7seOS0yovpsfr+ASBhkvfOGjz2qYQI5R3AITj1Gw jY3KU1Y4U6CjkhQUqBSWoMcABVTz+fFUeky+UBY8FPQnZn6Z/KlQi36nqmpc1Ecly7 AxNSDgIu1M+Ew== Date: Wed, 29 Sep 2021 09:25:52 -0700 From: Mike Rapoport To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, Andrew Morton , Michal Hocko , Oscar Salvador , Jianyong Wu , "Aneesh Kumar K . V" , Vineet Gupta , Geert Uytterhoeven , Huacai Chen , Jiaxun Yang , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Eric Biederman , Arnd Bergmann , linux-snps-arc@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, linux-mm@kvack.org, kexec@lists.infradead.org Subject: Re: [PATCH v1 2/4] memblock: allow to specify flags with memblock_add_node() Message-ID: References: <20210927150518.8607-1-david@redhat.com> <20210927150518.8607-3-david@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210927150518.8607-3-david@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210929_092554_577279_33ABB600 X-CRM114-Status: GOOD ( 31.09 ) X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org On Mon, Sep 27, 2021 at 05:05:16PM +0200, David Hildenbrand wrote: > We want to specify flags when hotplugging memory. Let's prepare to pass > flags to memblock_add_node() by adjusting all existing users. > > Note that when hotplugging memory the system is already up and running > and we don't want to add the memory first and apply flags later: it > should happen within one memblock call. Why is it important that the system is up and why it should happen in a single call? I don't mind adding flags parameter to memblock_add_node() but this changelog does not really explain the reasons to do it. > Signed-off-by: David Hildenbrand > --- > arch/arc/mm/init.c | 4 ++-- > arch/ia64/mm/contig.c | 2 +- > arch/ia64/mm/init.c | 2 +- > arch/m68k/mm/mcfmmu.c | 3 ++- > arch/m68k/mm/motorola.c | 6 ++++-- > arch/mips/loongson64/init.c | 4 +++- > arch/mips/sgi-ip27/ip27-memory.c | 3 ++- > arch/s390/kernel/setup.c | 3 ++- > include/linux/memblock.h | 3 ++- > include/linux/mm.h | 2 +- > mm/memblock.c | 9 +++++---- > mm/memory_hotplug.c | 2 +- > 12 files changed, 26 insertions(+), 17 deletions(-) > > diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c > index 699ecf119641..110eb69e9bee 100644 > --- a/arch/arc/mm/init.c > +++ b/arch/arc/mm/init.c > @@ -59,13 +59,13 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size) > > low_mem_sz = size; > in_use = 1; > - memblock_add_node(base, size, 0); > + memblock_add_node(base, size, 0, MEMBLOCK_NONE); > } else { > #ifdef CONFIG_HIGHMEM > high_mem_start = base; > high_mem_sz = size; > in_use = 1; > - memblock_add_node(base, size, 1); > + memblock_add_node(base, size, 1, MEMBLOCK_NONE); > memblock_reserve(base, size); > #endif > } > diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c > index 42e025cfbd08..24901d809301 100644 > --- a/arch/ia64/mm/contig.c > +++ b/arch/ia64/mm/contig.c > @@ -153,7 +153,7 @@ find_memory (void) > efi_memmap_walk(find_max_min_low_pfn, NULL); > max_pfn = max_low_pfn; > > - memblock_add_node(0, PFN_PHYS(max_low_pfn), 0); > + memblock_add_node(0, PFN_PHYS(max_low_pfn), 0, MEMBLOCK_NONE); > > find_initrd(); > > diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c > index 5c6da8d83c1a..5d165607bf35 100644 > --- a/arch/ia64/mm/init.c > +++ b/arch/ia64/mm/init.c > @@ -378,7 +378,7 @@ int __init register_active_ranges(u64 start, u64 len, int nid) > #endif > > if (start < end) > - memblock_add_node(__pa(start), end - start, nid); > + memblock_add_node(__pa(start), end - start, nid, MEMBLOCK_NONE); > return 0; > } > > diff --git a/arch/m68k/mm/mcfmmu.c b/arch/m68k/mm/mcfmmu.c > index eac9dde65193..6f1f25125294 100644 > --- a/arch/m68k/mm/mcfmmu.c > +++ b/arch/m68k/mm/mcfmmu.c > @@ -174,7 +174,8 @@ void __init cf_bootmem_alloc(void) > m68k_memory[0].addr = _rambase; > m68k_memory[0].size = _ramend - _rambase; > > - memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0); > + memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0, > + MEMBLOCK_NONE); > > /* compute total pages in system */ > num_pages = PFN_DOWN(_ramend - _rambase); > diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c > index 3a653f0a4188..e80c5d7e6728 100644 > --- a/arch/m68k/mm/motorola.c > +++ b/arch/m68k/mm/motorola.c > @@ -410,7 +410,8 @@ void __init paging_init(void) > > min_addr = m68k_memory[0].addr; > max_addr = min_addr + m68k_memory[0].size; > - memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0); > + memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0, > + MEMBLOCK_NONE); > for (i = 1; i < m68k_num_memory;) { > if (m68k_memory[i].addr < min_addr) { > printk("Ignoring memory chunk at 0x%lx:0x%lx before the first chunk\n", > @@ -421,7 +422,8 @@ void __init paging_init(void) > (m68k_num_memory - i) * sizeof(struct m68k_mem_info)); > continue; > } > - memblock_add_node(m68k_memory[i].addr, m68k_memory[i].size, i); > + memblock_add_node(m68k_memory[i].addr, m68k_memory[i].size, i, > + MEMBLOCK_NONE); > addr = m68k_memory[i].addr + m68k_memory[i].size; > if (addr > max_addr) > max_addr = addr; > diff --git a/arch/mips/loongson64/init.c b/arch/mips/loongson64/init.c > index 76e0a9636a0e..4ac5ba80bbf6 100644 > --- a/arch/mips/loongson64/init.c > +++ b/arch/mips/loongson64/init.c > @@ -77,7 +77,9 @@ void __init szmem(unsigned int node) > (u32)node_id, mem_type, mem_start, mem_size); > pr_info(" start_pfn:0x%llx, end_pfn:0x%llx, num_physpages:0x%lx\n", > start_pfn, end_pfn, num_physpages); > - memblock_add_node(PFN_PHYS(start_pfn), PFN_PHYS(node_psize), node); > + memblock_add_node(PFN_PHYS(start_pfn), > + PFN_PHYS(node_psize), node, > + MEMBLOCK_NONE); > break; > case SYSTEM_RAM_RESERVED: > pr_info("Node%d: mem_type:%d, mem_start:0x%llx, mem_size:0x%llx MB\n", > diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c > index 6173684b5aaa..adc2faeecf7c 100644 > --- a/arch/mips/sgi-ip27/ip27-memory.c > +++ b/arch/mips/sgi-ip27/ip27-memory.c > @@ -341,7 +341,8 @@ static void __init szmem(void) > continue; > } > memblock_add_node(PFN_PHYS(slot_getbasepfn(node, slot)), > - PFN_PHYS(slot_psize), node); > + PFN_PHYS(slot_psize), node, > + MEMBLOCK_NONE); > } > } > } > diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c > index 67e5fff96ee0..f3943f15af6e 100644 > --- a/arch/s390/kernel/setup.c > +++ b/arch/s390/kernel/setup.c > @@ -593,7 +593,8 @@ static void __init setup_resources(void) > * part of the System RAM resource. > */ > if (crashk_res.end) { > - memblock_add_node(crashk_res.start, resource_size(&crashk_res), 0); > + memblock_add_node(crashk_res.start, resource_size(&crashk_res), > + 0, MEMBLOCK_NONE); > memblock_reserve(crashk_res.start, resource_size(&crashk_res)); > insert_resource(&iomem_resource, &crashk_res); > } > diff --git a/include/linux/memblock.h b/include/linux/memblock.h > index 34de69b3b8ba..b49a58f621bc 100644 > --- a/include/linux/memblock.h > +++ b/include/linux/memblock.h > @@ -100,7 +100,8 @@ static inline void memblock_discard(void) {} > #endif > > void memblock_allow_resize(void); > -int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid); > +int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid, > + enum memblock_flags flags); > int memblock_add(phys_addr_t base, phys_addr_t size); > int memblock_remove(phys_addr_t base, phys_addr_t size); > int memblock_free(phys_addr_t base, phys_addr_t size); > diff --git a/include/linux/mm.h b/include/linux/mm.h > index 73a52aba448f..0117cb35b212 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -2447,7 +2447,7 @@ static inline unsigned long get_num_physpages(void) > * unsigned long max_zone_pfns[MAX_NR_ZONES] = {max_dma, max_normal_pfn, > * max_highmem_pfn}; > * for_each_valid_physical_page_range() > - * memblock_add_node(base, size, nid) > + * memblock_add_node(base, size, nid, MEMBLOCK_NONE) > * free_area_init(max_zone_pfns); > */ > void free_area_init(unsigned long *max_zone_pfn); > diff --git a/mm/memblock.c b/mm/memblock.c > index 184dcd2e5d99..47a56b223141 100644 > --- a/mm/memblock.c > +++ b/mm/memblock.c > @@ -655,6 +655,7 @@ static int __init_memblock memblock_add_range(struct memblock_type *type, > * @base: base address of the new region > * @size: size of the new region > * @nid: nid of the new region > + * @flags: flags of the new region > * > * Add new memblock region [@base, @base + @size) to the "memory" > * type. See memblock_add_range() description for mode details > @@ -663,14 +664,14 @@ static int __init_memblock memblock_add_range(struct memblock_type *type, > * 0 on success, -errno on failure. > */ > int __init_memblock memblock_add_node(phys_addr_t base, phys_addr_t size, > - int nid) > + int nid, enum memblock_flags flags) > { > phys_addr_t end = base + size - 1; > > - memblock_dbg("%s: [%pa-%pa] nid=%d %pS\n", __func__, > - &base, &end, nid, (void *)_RET_IP_); > + memblock_dbg("%s: [%pa-%pa] nid=%d flags=%x %pS\n", __func__, > + &base, &end, nid, flags, (void *)_RET_IP_); > > - return memblock_add_range(&memblock.memory, base, size, nid, 0); > + return memblock_add_range(&memblock.memory, base, size, nid, flags); > } > > /** > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > index 917b3528636d..5f873e7f5b29 100644 > --- a/mm/memory_hotplug.c > +++ b/mm/memory_hotplug.c > @@ -1385,7 +1385,7 @@ int __ref add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags) > mem_hotplug_begin(); > > if (IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK)) { > - ret = memblock_add_node(start, size, nid); > + ret = memblock_add_node(start, size, nid, MEMBLOCK_NONE); > if (ret) > goto error_mem_hotplug_end; > } > -- > 2.31.1 > -- Sincerely yours, Mike. _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Date: Wed, 29 Sep 2021 09:25:52 -0700 From: Mike Rapoport Subject: Re: [PATCH v1 2/4] memblock: allow to specify flags with memblock_add_node() Message-ID: References: <20210927150518.8607-1-david@redhat.com> <20210927150518.8607-3-david@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210927150518.8607-3-david@redhat.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, Andrew Morton , Michal Hocko , Oscar Salvador , Jianyong Wu , "Aneesh Kumar K . V" , Vineet Gupta , Geert Uytterhoeven , Huacai Chen , Jiaxun Yang , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Eric Biederman , Arnd Bergmann , linux-snps-arc@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, linux-mm@kvack.org, kexec@lists.infradead.org On Mon, Sep 27, 2021 at 05:05:16PM +0200, David Hildenbrand wrote: > We want to specify flags when hotplugging memory. Let's prepare to pass > flags to memblock_add_node() by adjusting all existing users. > > Note that when hotplugging memory the system is already up and running > and we don't want to add the memory first and apply flags later: it > should happen within one memblock call. Why is it important that the system is up and why it should happen in a single call? I don't mind adding flags parameter to memblock_add_node() but this changelog does not really explain the reasons to do it. > Signed-off-by: David Hildenbrand > --- > arch/arc/mm/init.c | 4 ++-- > arch/ia64/mm/contig.c | 2 +- > arch/ia64/mm/init.c | 2 +- > arch/m68k/mm/mcfmmu.c | 3 ++- > arch/m68k/mm/motorola.c | 6 ++++-- > arch/mips/loongson64/init.c | 4 +++- > arch/mips/sgi-ip27/ip27-memory.c | 3 ++- > arch/s390/kernel/setup.c | 3 ++- > include/linux/memblock.h | 3 ++- > include/linux/mm.h | 2 +- > mm/memblock.c | 9 +++++---- > mm/memory_hotplug.c | 2 +- > 12 files changed, 26 insertions(+), 17 deletions(-) > > diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c > index 699ecf119641..110eb69e9bee 100644 > --- a/arch/arc/mm/init.c > +++ b/arch/arc/mm/init.c > @@ -59,13 +59,13 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size) > > low_mem_sz = size; > in_use = 1; > - memblock_add_node(base, size, 0); > + memblock_add_node(base, size, 0, MEMBLOCK_NONE); > } else { > #ifdef CONFIG_HIGHMEM > high_mem_start = base; > high_mem_sz = size; > in_use = 1; > - memblock_add_node(base, size, 1); > + memblock_add_node(base, size, 1, MEMBLOCK_NONE); > memblock_reserve(base, size); > #endif > } > diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c > index 42e025cfbd08..24901d809301 100644 > --- a/arch/ia64/mm/contig.c > +++ b/arch/ia64/mm/contig.c > @@ -153,7 +153,7 @@ find_memory (void) > efi_memmap_walk(find_max_min_low_pfn, NULL); > max_pfn = max_low_pfn; > > - memblock_add_node(0, PFN_PHYS(max_low_pfn), 0); > + memblock_add_node(0, PFN_PHYS(max_low_pfn), 0, MEMBLOCK_NONE); > > find_initrd(); > > diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c > index 5c6da8d83c1a..5d165607bf35 100644 > --- a/arch/ia64/mm/init.c > +++ b/arch/ia64/mm/init.c > @@ -378,7 +378,7 @@ int __init register_active_ranges(u64 start, u64 len, int nid) > #endif > > if (start < end) > - memblock_add_node(__pa(start), end - start, nid); > + memblock_add_node(__pa(start), end - start, nid, MEMBLOCK_NONE); > return 0; > } > > diff --git a/arch/m68k/mm/mcfmmu.c b/arch/m68k/mm/mcfmmu.c > index eac9dde65193..6f1f25125294 100644 > --- a/arch/m68k/mm/mcfmmu.c > +++ b/arch/m68k/mm/mcfmmu.c > @@ -174,7 +174,8 @@ void __init cf_bootmem_alloc(void) > m68k_memory[0].addr = _rambase; > m68k_memory[0].size = _ramend - _rambase; > > - memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0); > + memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0, > + MEMBLOCK_NONE); > > /* compute total pages in system */ > num_pages = PFN_DOWN(_ramend - _rambase); > diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c > index 3a653f0a4188..e80c5d7e6728 100644 > --- a/arch/m68k/mm/motorola.c > +++ b/arch/m68k/mm/motorola.c > @@ -410,7 +410,8 @@ void __init paging_init(void) > > min_addr = m68k_memory[0].addr; > max_addr = min_addr + m68k_memory[0].size; > - memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0); > + memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0, > + MEMBLOCK_NONE); > for (i = 1; i < m68k_num_memory;) { > if (m68k_memory[i].addr < min_addr) { > printk("Ignoring memory chunk at 0x%lx:0x%lx before the first chunk\n", > @@ -421,7 +422,8 @@ void __init paging_init(void) > (m68k_num_memory - i) * sizeof(struct m68k_mem_info)); > continue; > } > - memblock_add_node(m68k_memory[i].addr, m68k_memory[i].size, i); > + memblock_add_node(m68k_memory[i].addr, m68k_memory[i].size, i, > + MEMBLOCK_NONE); > addr = m68k_memory[i].addr + m68k_memory[i].size; > if (addr > max_addr) > max_addr = addr; > diff --git a/arch/mips/loongson64/init.c b/arch/mips/loongson64/init.c > index 76e0a9636a0e..4ac5ba80bbf6 100644 > --- a/arch/mips/loongson64/init.c > +++ b/arch/mips/loongson64/init.c > @@ -77,7 +77,9 @@ void __init szmem(unsigned int node) > (u32)node_id, mem_type, mem_start, mem_size); > pr_info(" start_pfn:0x%llx, end_pfn:0x%llx, num_physpages:0x%lx\n", > start_pfn, end_pfn, num_physpages); > - memblock_add_node(PFN_PHYS(start_pfn), PFN_PHYS(node_psize), node); > + memblock_add_node(PFN_PHYS(start_pfn), > + PFN_PHYS(node_psize), node, > + MEMBLOCK_NONE); > break; > case SYSTEM_RAM_RESERVED: > pr_info("Node%d: mem_type:%d, mem_start:0x%llx, mem_size:0x%llx MB\n", > diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c > index 6173684b5aaa..adc2faeecf7c 100644 > --- a/arch/mips/sgi-ip27/ip27-memory.c > +++ b/arch/mips/sgi-ip27/ip27-memory.c > @@ -341,7 +341,8 @@ static void __init szmem(void) > continue; > } > memblock_add_node(PFN_PHYS(slot_getbasepfn(node, slot)), > - PFN_PHYS(slot_psize), node); > + PFN_PHYS(slot_psize), node, > + MEMBLOCK_NONE); > } > } > } > diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c > index 67e5fff96ee0..f3943f15af6e 100644 > --- a/arch/s390/kernel/setup.c > +++ b/arch/s390/kernel/setup.c > @@ -593,7 +593,8 @@ static void __init setup_resources(void) > * part of the System RAM resource. > */ > if (crashk_res.end) { > - memblock_add_node(crashk_res.start, resource_size(&crashk_res), 0); > + memblock_add_node(crashk_res.start, resource_size(&crashk_res), > + 0, MEMBLOCK_NONE); > memblock_reserve(crashk_res.start, resource_size(&crashk_res)); > insert_resource(&iomem_resource, &crashk_res); > } > diff --git a/include/linux/memblock.h b/include/linux/memblock.h > index 34de69b3b8ba..b49a58f621bc 100644 > --- a/include/linux/memblock.h > +++ b/include/linux/memblock.h > @@ -100,7 +100,8 @@ static inline void memblock_discard(void) {} > #endif > > void memblock_allow_resize(void); > -int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid); > +int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid, > + enum memblock_flags flags); > int memblock_add(phys_addr_t base, phys_addr_t size); > int memblock_remove(phys_addr_t base, phys_addr_t size); > int memblock_free(phys_addr_t base, phys_addr_t size); > diff --git a/include/linux/mm.h b/include/linux/mm.h > index 73a52aba448f..0117cb35b212 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -2447,7 +2447,7 @@ static inline unsigned long get_num_physpages(void) > * unsigned long max_zone_pfns[MAX_NR_ZONES] = {max_dma, max_normal_pfn, > * max_highmem_pfn}; > * for_each_valid_physical_page_range() > - * memblock_add_node(base, size, nid) > + * memblock_add_node(base, size, nid, MEMBLOCK_NONE) > * free_area_init(max_zone_pfns); > */ > void free_area_init(unsigned long *max_zone_pfn); > diff --git a/mm/memblock.c b/mm/memblock.c > index 184dcd2e5d99..47a56b223141 100644 > --- a/mm/memblock.c > +++ b/mm/memblock.c > @@ -655,6 +655,7 @@ static int __init_memblock memblock_add_range(struct memblock_type *type, > * @base: base address of the new region > * @size: size of the new region > * @nid: nid of the new region > + * @flags: flags of the new region > * > * Add new memblock region [@base, @base + @size) to the "memory" > * type. See memblock_add_range() description for mode details > @@ -663,14 +664,14 @@ static int __init_memblock memblock_add_range(struct memblock_type *type, > * 0 on success, -errno on failure. > */ > int __init_memblock memblock_add_node(phys_addr_t base, phys_addr_t size, > - int nid) > + int nid, enum memblock_flags flags) > { > phys_addr_t end = base + size - 1; > > - memblock_dbg("%s: [%pa-%pa] nid=%d %pS\n", __func__, > - &base, &end, nid, (void *)_RET_IP_); > + memblock_dbg("%s: [%pa-%pa] nid=%d flags=%x %pS\n", __func__, > + &base, &end, nid, flags, (void *)_RET_IP_); > > - return memblock_add_range(&memblock.memory, base, size, nid, 0); > + return memblock_add_range(&memblock.memory, base, size, nid, flags); > } > > /** > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > index 917b3528636d..5f873e7f5b29 100644 > --- a/mm/memory_hotplug.c > +++ b/mm/memory_hotplug.c > @@ -1385,7 +1385,7 @@ int __ref add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags) > mem_hotplug_begin(); > > if (IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK)) { > - ret = memblock_add_node(start, size, nid); > + ret = memblock_add_node(start, size, nid, MEMBLOCK_NONE); > if (ret) > goto error_mem_hotplug_end; > } > -- > 2.31.1 > -- Sincerely yours, Mike. _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Rapoport Date: Wed, 29 Sep 2021 16:25:52 +0000 Subject: Re: [PATCH v1 2/4] memblock: allow to specify flags with memblock_add_node() Message-Id: List-Id: References: <20210927150518.8607-1-david@redhat.com> <20210927150518.8607-3-david@redhat.com> In-Reply-To: <20210927150518.8607-3-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, Andrew Morton , Michal Hocko , Oscar Salvador , Jianyong Wu , "Aneesh Kumar K . V" , Vineet Gupta , Geert Uytterhoeven , Huacai Chen , Jiaxun Yang , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Eric Biederman , Arnd Bergmann , linux-snps-arc@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, linux-mm@kvack.org, kexec@lists.infradead.org On Mon, Sep 27, 2021 at 05:05:16PM +0200, David Hildenbrand wrote: > We want to specify flags when hotplugging memory. Let's prepare to pass > flags to memblock_add_node() by adjusting all existing users. > > Note that when hotplugging memory the system is already up and running > and we don't want to add the memory first and apply flags later: it > should happen within one memblock call. Why is it important that the system is up and why it should happen in a single call? I don't mind adding flags parameter to memblock_add_node() but this changelog does not really explain the reasons to do it. > Signed-off-by: David Hildenbrand > --- > arch/arc/mm/init.c | 4 ++-- > arch/ia64/mm/contig.c | 2 +- > arch/ia64/mm/init.c | 2 +- > arch/m68k/mm/mcfmmu.c | 3 ++- > arch/m68k/mm/motorola.c | 6 ++++-- > arch/mips/loongson64/init.c | 4 +++- > arch/mips/sgi-ip27/ip27-memory.c | 3 ++- > arch/s390/kernel/setup.c | 3 ++- > include/linux/memblock.h | 3 ++- > include/linux/mm.h | 2 +- > mm/memblock.c | 9 +++++---- > mm/memory_hotplug.c | 2 +- > 12 files changed, 26 insertions(+), 17 deletions(-) > > diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c > index 699ecf119641..110eb69e9bee 100644 > --- a/arch/arc/mm/init.c > +++ b/arch/arc/mm/init.c > @@ -59,13 +59,13 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size) > > low_mem_sz = size; > in_use = 1; > - memblock_add_node(base, size, 0); > + memblock_add_node(base, size, 0, MEMBLOCK_NONE); > } else { > #ifdef CONFIG_HIGHMEM > high_mem_start = base; > high_mem_sz = size; > in_use = 1; > - memblock_add_node(base, size, 1); > + memblock_add_node(base, size, 1, MEMBLOCK_NONE); > memblock_reserve(base, size); > #endif > } > diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c > index 42e025cfbd08..24901d809301 100644 > --- a/arch/ia64/mm/contig.c > +++ b/arch/ia64/mm/contig.c > @@ -153,7 +153,7 @@ find_memory (void) > efi_memmap_walk(find_max_min_low_pfn, NULL); > max_pfn = max_low_pfn; > > - memblock_add_node(0, PFN_PHYS(max_low_pfn), 0); > + memblock_add_node(0, PFN_PHYS(max_low_pfn), 0, MEMBLOCK_NONE); > > find_initrd(); > > diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c > index 5c6da8d83c1a..5d165607bf35 100644 > --- a/arch/ia64/mm/init.c > +++ b/arch/ia64/mm/init.c > @@ -378,7 +378,7 @@ int __init register_active_ranges(u64 start, u64 len, int nid) > #endif > > if (start < end) > - memblock_add_node(__pa(start), end - start, nid); > + memblock_add_node(__pa(start), end - start, nid, MEMBLOCK_NONE); > return 0; > } > > diff --git a/arch/m68k/mm/mcfmmu.c b/arch/m68k/mm/mcfmmu.c > index eac9dde65193..6f1f25125294 100644 > --- a/arch/m68k/mm/mcfmmu.c > +++ b/arch/m68k/mm/mcfmmu.c > @@ -174,7 +174,8 @@ void __init cf_bootmem_alloc(void) > m68k_memory[0].addr = _rambase; > m68k_memory[0].size = _ramend - _rambase; > > - memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0); > + memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0, > + MEMBLOCK_NONE); > > /* compute total pages in system */ > num_pages = PFN_DOWN(_ramend - _rambase); > diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c > index 3a653f0a4188..e80c5d7e6728 100644 > --- a/arch/m68k/mm/motorola.c > +++ b/arch/m68k/mm/motorola.c > @@ -410,7 +410,8 @@ void __init paging_init(void) > > min_addr = m68k_memory[0].addr; > max_addr = min_addr + m68k_memory[0].size; > - memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0); > + memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0, > + MEMBLOCK_NONE); > for (i = 1; i < m68k_num_memory;) { > if (m68k_memory[i].addr < min_addr) { > printk("Ignoring memory chunk at 0x%lx:0x%lx before the first chunk\n", > @@ -421,7 +422,8 @@ void __init paging_init(void) > (m68k_num_memory - i) * sizeof(struct m68k_mem_info)); > continue; > } > - memblock_add_node(m68k_memory[i].addr, m68k_memory[i].size, i); > + memblock_add_node(m68k_memory[i].addr, m68k_memory[i].size, i, > + MEMBLOCK_NONE); > addr = m68k_memory[i].addr + m68k_memory[i].size; > if (addr > max_addr) > max_addr = addr; > diff --git a/arch/mips/loongson64/init.c b/arch/mips/loongson64/init.c > index 76e0a9636a0e..4ac5ba80bbf6 100644 > --- a/arch/mips/loongson64/init.c > +++ b/arch/mips/loongson64/init.c > @@ -77,7 +77,9 @@ void __init szmem(unsigned int node) > (u32)node_id, mem_type, mem_start, mem_size); > pr_info(" start_pfn:0x%llx, end_pfn:0x%llx, num_physpages:0x%lx\n", > start_pfn, end_pfn, num_physpages); > - memblock_add_node(PFN_PHYS(start_pfn), PFN_PHYS(node_psize), node); > + memblock_add_node(PFN_PHYS(start_pfn), > + PFN_PHYS(node_psize), node, > + MEMBLOCK_NONE); > break; > case SYSTEM_RAM_RESERVED: > pr_info("Node%d: mem_type:%d, mem_start:0x%llx, mem_size:0x%llx MB\n", > diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c > index 6173684b5aaa..adc2faeecf7c 100644 > --- a/arch/mips/sgi-ip27/ip27-memory.c > +++ b/arch/mips/sgi-ip27/ip27-memory.c > @@ -341,7 +341,8 @@ static void __init szmem(void) > continue; > } > memblock_add_node(PFN_PHYS(slot_getbasepfn(node, slot)), > - PFN_PHYS(slot_psize), node); > + PFN_PHYS(slot_psize), node, > + MEMBLOCK_NONE); > } > } > } > diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c > index 67e5fff96ee0..f3943f15af6e 100644 > --- a/arch/s390/kernel/setup.c > +++ b/arch/s390/kernel/setup.c > @@ -593,7 +593,8 @@ static void __init setup_resources(void) > * part of the System RAM resource. > */ > if (crashk_res.end) { > - memblock_add_node(crashk_res.start, resource_size(&crashk_res), 0); > + memblock_add_node(crashk_res.start, resource_size(&crashk_res), > + 0, MEMBLOCK_NONE); > memblock_reserve(crashk_res.start, resource_size(&crashk_res)); > insert_resource(&iomem_resource, &crashk_res); > } > diff --git a/include/linux/memblock.h b/include/linux/memblock.h > index 34de69b3b8ba..b49a58f621bc 100644 > --- a/include/linux/memblock.h > +++ b/include/linux/memblock.h > @@ -100,7 +100,8 @@ static inline void memblock_discard(void) {} > #endif > > void memblock_allow_resize(void); > -int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid); > +int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid, > + enum memblock_flags flags); > int memblock_add(phys_addr_t base, phys_addr_t size); > int memblock_remove(phys_addr_t base, phys_addr_t size); > int memblock_free(phys_addr_t base, phys_addr_t size); > diff --git a/include/linux/mm.h b/include/linux/mm.h > index 73a52aba448f..0117cb35b212 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -2447,7 +2447,7 @@ static inline unsigned long get_num_physpages(void) > * unsigned long max_zone_pfns[MAX_NR_ZONES] = {max_dma, max_normal_pfn, > * max_highmem_pfn}; > * for_each_valid_physical_page_range() > - * memblock_add_node(base, size, nid) > + * memblock_add_node(base, size, nid, MEMBLOCK_NONE) > * free_area_init(max_zone_pfns); > */ > void free_area_init(unsigned long *max_zone_pfn); > diff --git a/mm/memblock.c b/mm/memblock.c > index 184dcd2e5d99..47a56b223141 100644 > --- a/mm/memblock.c > +++ b/mm/memblock.c > @@ -655,6 +655,7 @@ static int __init_memblock memblock_add_range(struct memblock_type *type, > * @base: base address of the new region > * @size: size of the new region > * @nid: nid of the new region > + * @flags: flags of the new region > * > * Add new memblock region [@base, @base + @size) to the "memory" > * type. See memblock_add_range() description for mode details > @@ -663,14 +664,14 @@ static int __init_memblock memblock_add_range(struct memblock_type *type, > * 0 on success, -errno on failure. > */ > int __init_memblock memblock_add_node(phys_addr_t base, phys_addr_t size, > - int nid) > + int nid, enum memblock_flags flags) > { > phys_addr_t end = base + size - 1; > > - memblock_dbg("%s: [%pa-%pa] nid=%d %pS\n", __func__, > - &base, &end, nid, (void *)_RET_IP_); > + memblock_dbg("%s: [%pa-%pa] nid=%d flags=%x %pS\n", __func__, > + &base, &end, nid, flags, (void *)_RET_IP_); > > - return memblock_add_range(&memblock.memory, base, size, nid, 0); > + return memblock_add_range(&memblock.memory, base, size, nid, flags); > } > > /** > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > index 917b3528636d..5f873e7f5b29 100644 > --- a/mm/memory_hotplug.c > +++ b/mm/memory_hotplug.c > @@ -1385,7 +1385,7 @@ int __ref add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags) > mem_hotplug_begin(); > > if (IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK)) { > - ret = memblock_add_node(start, size, nid); > + ret = memblock_add_node(start, size, nid, MEMBLOCK_NONE); > if (ret) > goto error_mem_hotplug_end; > } > -- > 2.31.1 > -- Sincerely yours, Mike.