Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp749400pxv; Wed, 14 Jul 2021 14:46:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQUgGIu4aXPgZUra1GpWjO1ismEhbLzr2lJ772/HE6ukQVeTb17u2FcXZoBxXBYV7/8lcE X-Received: by 2002:a6b:e714:: with SMTP id b20mr167815ioh.168.1626299167205; Wed, 14 Jul 2021 14:46:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626299167; cv=none; d=google.com; s=arc-20160816; b=KYPHwTU1FBObAud2lb98bl+FFu2++14nSlrtlXxX5NcNTEFNSczf+ZkSuZyQ1yRHfr G9DGUti7Xa3LHADfWRzvXCoIM2t/16UE3LfauYZE6jmAszBEfvoZleB/jZg1mr0KQyHj ihVa6FrfH3Gt/+7s9DW99lr0jcEumQbgDWH40h4Wkv2UQDi/Ofg4Gq/giqd6LYeHts8z 4xMQ4yE6ZO1ZCq0LjM56vW6HWw2D2xMGTTzzW3JudkeAHQh6SGmxU9q1rKw4u7Z9BLKF kbljD2kIctH2YBOrses0Bo659WzfWQ0U8tbVeIEdg6cHjHO4zCLYu2lfgXfB9TdpRgjS q/DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=hvhFUaJpsKWtTEeD2+NVxurp5yWKuTzZW3b3jtSmo5Y=; b=rqRjfJ/PvXD5XG5L/WQtDOLjCZbNjbVysrI+vGx1r6dlee36TMnVgk8V8llLbq6CSd VizsUm+pcLINPig+H127fPEygPY0/wUIRIbfEahJP+td4tRHEPNIycNoo2tB297rI5Hb VH6YjT1YqGi8IbtQELn7G9ZGbFiUT92xpfUPcL6XIgcdtDmVvQphsPADpxckq1dYz8Fx izBNzj6u8jvu1TF19jjm3ciyvGMplq+ieESC7eR+t8T0K3Yf2ye3bncBLqH84+bAG7cv PzpcVLyaS4n81undzTG8dxImH/wGJmVT9AgV0f6W7xNGO9D477DC8klWrBCo9Y7CHqVs 6Yjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UUnwQaua; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w3si3751177ilh.113.2021.07.14.14.45.54; Wed, 14 Jul 2021 14:46:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UUnwQaua; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233782AbhGNUum (ORCPT + 99 others); Wed, 14 Jul 2021 16:50:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230352AbhGNUul (ORCPT ); Wed, 14 Jul 2021 16:50:41 -0400 Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB707C06175F; Wed, 14 Jul 2021 13:47:49 -0700 (PDT) Received: by mail-il1-x136.google.com with SMTP id e2so2935945ilu.5; Wed, 14 Jul 2021 13:47:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hvhFUaJpsKWtTEeD2+NVxurp5yWKuTzZW3b3jtSmo5Y=; b=UUnwQaua/H8rwEJ46wBGu21VE3YZ4bJWf1X9TiXDo9vh0gjpsjTI69qTz8pUIOeQmZ 87sYgU7NQ2/IywPIyzuJgPagS9NB5ilUObP1yaPA/AaIMC2BENX2XW8OmvNHcjIZzcqQ lCJKYYFk7pgPjzvPFxoMU8RBALA3Hs5cTmm/buog1pLIyQXWBKa5ks+NtYkm7Xs9p1/4 9bfr6Tuk3tiShJOZYSkFcJbqC1a6xfK4TJacBP5OeWgIBt7iJpXiEuB2Btyl4Pu/1mqs QL/3W25VvEP2vW3CnG/H9MMRVuhf6MAjCdkOTJ68fiKoyj5Vp4y4pfExBy7Ej62pduDV nCew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hvhFUaJpsKWtTEeD2+NVxurp5yWKuTzZW3b3jtSmo5Y=; b=UovxUEIqcNVlFrKSnN2F6eUcHEyYlrcCQj0LEifdTr7udouVGuppmOOq5F3lE1qmeF IGDAudpEo4LaGQCvNsxuXQJfejo13W4Cvoa8qw1mNVO0CNxZNoJLjrsCUsk5jouzl0sZ vIl5DvrYG6pF9s8/ap+V67kYD45bkA9onRKZc5Yo9HZQ1V2xXA7/8+SSwLPUeooIwWCr VUNw8Y+wk8sJ1KbNUV8skVdaQxxSipY0esYAEWPGTXj6jvvxkP73cg5Sy1ocZRVqb2Rh FFYy0JO0wivBW/BPLm4FBSMB37Y7Xr/hPwwBx/VHlqtXwMhOIpqdD91AOHAu2sHougaD cwuQ== X-Gm-Message-State: AOAM533BASkU180L7vOshtV+bxhepW7FJ5MFHfOVN/bky3qZYGyKr13T 58kD0N+4e6quVAeKMA+h6NPu61CijRnYCwXx6xw= X-Received: by 2002:a92:a005:: with SMTP id e5mr7715143ili.22.1626295669171; Wed, 14 Jul 2021 13:47:49 -0700 (PDT) MIME-Version: 1.0 References: <20210712124052.26491-1-david@redhat.com> <20210712124052.26491-3-david@redhat.com> In-Reply-To: <20210712124052.26491-3-david@redhat.com> From: Pankaj Gupta Date: Wed, 14 Jul 2021 22:47:38 +0200 Message-ID: Subject: Re: [PATCH v1 2/4] mm/memory_hotplug: remove nid parameter from arch_remove_memory() To: David Hildenbrand Cc: LKML , Linux MM , Andrew Morton , Vitaly Kuznetsov , "Michael S. Tsirkin" , Jason Wang , Wei Yang , Oscar Salvador , Michal Hocko , Dan Williams , Anshuman Khandual , Dave Hansen , Vlastimil Babka , Mike Rapoport , "Rafael J. Wysocki" , Len Brown , Pavel Tatashin , Heiko Carstens , Michael Ellerman , Catalin Marinas , virtualization@lists.linux-foundation.org, linux-acpi@vger.kernel.org, Andy Lutomirski , "Aneesh Kumar K.V" , Anton Blanchard , Ard Biesheuvel , Baoquan He , Benjamin Herrenschmidt , Borislav Petkov , Christian Borntraeger , Christophe Leroy , Dave Jiang , "H. Peter Anvin" , Ingo Molnar , Jia He , Joe Perches , Kefeng Wang , Laurent Dufour , Michel Lespinasse , Nathan Lynch , Nicholas Piggin , Paul Mackerras , Peter Zijlstra , Pierre Morel , "Rafael J. Wysocki" , Rich Felker , Scott Cheloha , Sergei Trofimovich , Thiago Jung Bauermann , Thomas Gleixner , Vasily Gorbik , Vishal Verma , Will Deacon , Yoshinori Sato , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > The parameter is unused, let's remove it. > > Acked-by: Catalin Marinas > Acked-by: Michael Ellerman (powerpc) > Acked-by: Heiko Carstens (s390) > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Michael Ellerman > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Heiko Carstens > Cc: Vasily Gorbik > Cc: Christian Borntraeger > Cc: Yoshinori Sato > Cc: Rich Felker > Cc: Dave Hansen > Cc: Andy Lutomirski > Cc: Peter Zijlstra > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: Borislav Petkov > Cc: x86@kernel.org > Cc: "H. Peter Anvin" > Cc: Andrew Morton > Cc: Anshuman Khandual > Cc: Ard Biesheuvel > Cc: Mike Rapoport > Cc: Nicholas Piggin > Cc: Pavel Tatashin > Cc: Baoquan He > Cc: Laurent Dufour > Cc: Sergei Trofimovich > Cc: Kefeng Wang > Cc: Michel Lespinasse > Cc: Christophe Leroy > Cc: "Aneesh Kumar K.V" > Cc: Thiago Jung Bauermann > Cc: Joe Perches > Cc: Pierre Morel > Cc: Jia He > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-ia64@vger.kernel.org > Cc: linuxppc-dev@lists.ozlabs.org > Cc: linux-s390@vger.kernel.org > Cc: linux-sh@vger.kernel.org > Signed-off-by: David Hildenbrand > --- > arch/arm64/mm/mmu.c | 3 +-- > arch/ia64/mm/init.c | 3 +-- > arch/powerpc/mm/mem.c | 3 +-- > arch/s390/mm/init.c | 3 +-- > arch/sh/mm/init.c | 3 +-- > arch/x86/mm/init_32.c | 3 +-- > arch/x86/mm/init_64.c | 3 +-- > include/linux/memory_hotplug.h | 3 +-- > mm/memory_hotplug.c | 4 ++-- > mm/memremap.c | 5 +---- > 10 files changed, 11 insertions(+), 22 deletions(-) > > diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c > index d74586508448..af8ab553a268 100644 > --- a/arch/arm64/mm/mmu.c > +++ b/arch/arm64/mm/mmu.c > @@ -1506,8 +1506,7 @@ int arch_add_memory(int nid, u64 start, u64 size, > return ret; > } > > -void arch_remove_memory(int nid, u64 start, u64 size, > - struct vmem_altmap *altmap) > +void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap) > { > unsigned long start_pfn = start >> PAGE_SHIFT; > unsigned long nr_pages = size >> PAGE_SHIFT; > diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c > index 064a967a7b6e..5c6da8d83c1a 100644 > --- a/arch/ia64/mm/init.c > +++ b/arch/ia64/mm/init.c > @@ -484,8 +484,7 @@ int arch_add_memory(int nid, u64 start, u64 size, > return ret; > } > > -void arch_remove_memory(int nid, u64 start, u64 size, > - struct vmem_altmap *altmap) > +void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap) > { > unsigned long start_pfn = start >> PAGE_SHIFT; > unsigned long nr_pages = size >> PAGE_SHIFT; > diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c > index ad198b439222..c3c4e31462ec 100644 > --- a/arch/powerpc/mm/mem.c > +++ b/arch/powerpc/mm/mem.c > @@ -119,8 +119,7 @@ int __ref arch_add_memory(int nid, u64 start, u64 size, > return rc; > } > > -void __ref arch_remove_memory(int nid, u64 start, u64 size, > - struct vmem_altmap *altmap) > +void __ref arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap) > { > unsigned long start_pfn = start >> PAGE_SHIFT; > unsigned long nr_pages = size >> PAGE_SHIFT; > diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c > index 8ac710de1ab1..d85bd7f5d8dc 100644 > --- a/arch/s390/mm/init.c > +++ b/arch/s390/mm/init.c > @@ -306,8 +306,7 @@ int arch_add_memory(int nid, u64 start, u64 size, > return rc; > } > > -void arch_remove_memory(int nid, u64 start, u64 size, > - struct vmem_altmap *altmap) > +void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap) > { > unsigned long start_pfn = start >> PAGE_SHIFT; > unsigned long nr_pages = size >> PAGE_SHIFT; > diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c > index ce26c7f8950a..506784702430 100644 > --- a/arch/sh/mm/init.c > +++ b/arch/sh/mm/init.c > @@ -414,8 +414,7 @@ int arch_add_memory(int nid, u64 start, u64 size, > return ret; > } > > -void arch_remove_memory(int nid, u64 start, u64 size, > - struct vmem_altmap *altmap) > +void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap) > { > unsigned long start_pfn = PFN_DOWN(start); > unsigned long nr_pages = size >> PAGE_SHIFT; > diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c > index 74b78840182d..bd90b8fe81e4 100644 > --- a/arch/x86/mm/init_32.c > +++ b/arch/x86/mm/init_32.c > @@ -801,8 +801,7 @@ int arch_add_memory(int nid, u64 start, u64 size, > return __add_pages(nid, start_pfn, nr_pages, params); > } > > -void arch_remove_memory(int nid, u64 start, u64 size, > - struct vmem_altmap *altmap) > +void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap) > { > unsigned long start_pfn = start >> PAGE_SHIFT; > unsigned long nr_pages = size >> PAGE_SHIFT; > diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c > index ddeaba947eb3..a6e11763763f 100644 > --- a/arch/x86/mm/init_64.c > +++ b/arch/x86/mm/init_64.c > @@ -1255,8 +1255,7 @@ kernel_physical_mapping_remove(unsigned long start, unsigned long end) > remove_pagetable(start, end, true, NULL); > } > > -void __ref arch_remove_memory(int nid, u64 start, u64 size, > - struct vmem_altmap *altmap) > +void __ref arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap) > { > unsigned long start_pfn = start >> PAGE_SHIFT; > unsigned long nr_pages = size >> PAGE_SHIFT; > diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h > index d01b504ce06f..010a192298b5 100644 > --- a/include/linux/memory_hotplug.h > +++ b/include/linux/memory_hotplug.h > @@ -130,8 +130,7 @@ static inline bool movable_node_is_enabled(void) > return movable_node_enabled; > } > > -extern void arch_remove_memory(int nid, u64 start, u64 size, > - struct vmem_altmap *altmap); > +extern void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap); > extern void __remove_pages(unsigned long start_pfn, unsigned long nr_pages, > struct vmem_altmap *altmap); > > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > index 93b3abaf9828..f2a9af3af184 100644 > --- a/mm/memory_hotplug.c > +++ b/mm/memory_hotplug.c > @@ -1106,7 +1106,7 @@ int __ref add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags) > /* create memory block devices after memory was added */ > ret = create_memory_block_devices(start, size, mhp_altmap.alloc); > if (ret) { > - arch_remove_memory(nid, start, size, NULL); > + arch_remove_memory(start, size, NULL); > goto error; > } > > @@ -1892,7 +1892,7 @@ static int __ref try_remove_memory(int nid, u64 start, u64 size) > > mem_hotplug_begin(); > > - arch_remove_memory(nid, start, size, altmap); > + arch_remove_memory(start, size, altmap); > > if (IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK)) { > memblock_free(start, size); > diff --git a/mm/memremap.c b/mm/memremap.c > index 15a074ffb8d7..ed593bf87109 100644 > --- a/mm/memremap.c > +++ b/mm/memremap.c > @@ -140,14 +140,11 @@ static void pageunmap_range(struct dev_pagemap *pgmap, int range_id) > { > struct range *range = &pgmap->ranges[range_id]; > struct page *first_page; > - int nid; > > /* make sure to access a memmap that was actually initialized */ > first_page = pfn_to_page(pfn_first(pgmap, range_id)); > > /* pages are dead and unused, undo the arch mapping */ > - nid = page_to_nid(first_page); > - > mem_hotplug_begin(); > remove_pfn_range_from_zone(page_zone(first_page), PHYS_PFN(range->start), > PHYS_PFN(range_len(range))); > @@ -155,7 +152,7 @@ static void pageunmap_range(struct dev_pagemap *pgmap, int range_id) > __remove_pages(PHYS_PFN(range->start), > PHYS_PFN(range_len(range)), NULL); > } else { > - arch_remove_memory(nid, range->start, range_len(range), > + arch_remove_memory(range->start, range_len(range), > pgmap_altmap(pgmap)); > kasan_remove_zero_shadow(__va(range->start), range_len(range)); > } Reviewed-by: Pankaj Gupta