From: Michael Ellerman <mpe@ellerman•id.au>
To: David Hildenbrand <david@redhat•com>, linux-kernel@vger•kernel.org
Cc: nvdimm@lists•linux.dev,
Wei Yang <richard.weiyang@linux•alibaba.com>,
"Michael S. Tsirkin" <mst@redhat•com>,
Jason Wang <jasowang@redhat•com>,
Dave Hansen <dave.hansen@linux•intel.com>,
virtualization@lists•linux-foundation.org, linux-mm@kvack•org,
Paul Mackerras <paulus@samba•org>,
Laurent Dufour <ldufour@linux•ibm.com>,
Dave Jiang <dave.jiang@intel•com>,
Vishal Verma <vishal.l.verma@intel•com>,
David Hildenbrand <david@redhat•com>,
linux-acpi@vger•kernel.org, Len Brown <lenb@kernel•org>,
Nathan Lynch <nathanl@linux•ibm.com>,
Pavel Tatashin <pasha.tatashin@soleen•com>,
Anshuman Khandual <anshuman.khandual@arm•com>,
Dan Williams <dan.j.williams@intel•com>,
Michal Hocko <mhocko@kernel•org>,
Vitaly Kuznetsov <vkuznets@redhat•com>,
Vlastimil Babka <vbabka@suse•cz>,
Oscar Salvador <osalvador@suse•de>,
Pankaj Gupta <pankaj.gupta.linux@gmail•com>,
Scott Cheloha <cheloha@linux•ibm.com>,
"Rafael J. Wysocki" <rjw@rjwysocki•net>,
Hui Zhu <teawater@gmail•com>,
"Aneesh Kumar K.V" <aneesh.kumar@linux•ibm.com>,
Andrew Morton <akpm@linux-foundation•org>,
linuxppc-dev@lists•ozlabs.org,
Marek Kedzierski <mkedzier@redhat•com>,
Mike Rapoport <rppt@kernel•org>
Subject: Re: [PATCH v1 05/12] mm/memory_hotplug: remove nid parameter from remove_memory() and friends
Date: Tue, 08 Jun 2021 21:11:57 +1000 [thread overview]
Message-ID: <87y2bkehky.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <20210607195430.48228-6-david@redhat.com>
David Hildenbrand <david@redhat•com> writes:
> There is only a single user remaining. We can simply try to offline all
> online nodes - which is fast, because we usually span pages and can skip
> such nodes right away.
That makes me slightly nervous, because our big powerpc boxes tend to
trip on these scaling issues before others.
But the spanned pages check is just:
void try_offline_node(int nid)
{
pg_data_t *pgdat = NODE_DATA(nid);
...
if (pgdat->node_spanned_pages)
return;
So I guess that's pretty cheap, and it's only O(nodes), which should
never get that big.
> Cc: Michael Ellerman <mpe@ellerman•id.au>
> Cc: Benjamin Herrenschmidt <benh@kernel•crashing.org>
> Cc: Paul Mackerras <paulus@samba•org>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki•net>
> Cc: Len Brown <lenb@kernel•org>
> Cc: Dan Williams <dan.j.williams@intel•com>
> Cc: Vishal Verma <vishal.l.verma@intel•com>
> Cc: Dave Jiang <dave.jiang@intel•com>
> Cc: "Michael S. Tsirkin" <mst@redhat•com>
> Cc: Jason Wang <jasowang@redhat•com>
> Cc: Andrew Morton <akpm@linux-foundation•org>
> Cc: Nathan Lynch <nathanl@linux•ibm.com>
> Cc: Laurent Dufour <ldufour@linux•ibm.com>
> Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux•ibm.com>
> Cc: Scott Cheloha <cheloha@linux•ibm.com>
> Cc: Anton Blanchard <anton@ozlabs•org>
> Cc: linuxppc-dev@lists•ozlabs.org
> Cc: linux-acpi@vger•kernel.org
> Cc: nvdimm@lists•linux.dev
> Signed-off-by: David Hildenbrand <david@redhat•com>
> ---
> .../platforms/pseries/hotplug-memory.c | 9 ++++-----
> drivers/acpi/acpi_memhotplug.c | 7 +------
> drivers/dax/kmem.c | 3 +--
> drivers/virtio/virtio_mem.c | 4 ++--
> include/linux/memory_hotplug.h | 10 +++++-----
> mm/memory_hotplug.c | 20 +++++++++----------
> 6 files changed, 23 insertions(+), 30 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
> index 8377f1f7c78e..4a9232ddbefe 100644
> --- a/arch/powerpc/platforms/pseries/hotplug-memory.c
> +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
> @@ -286,7 +286,7 @@ static int pseries_remove_memblock(unsigned long base, unsigned long memblock_si
> {
> unsigned long block_sz, start_pfn;
> int sections_per_block;
> - int i, nid;
> + int i;
>
> start_pfn = base >> PAGE_SHIFT;
>
> @@ -297,10 +297,9 @@ static int pseries_remove_memblock(unsigned long base, unsigned long memblock_si
>
> block_sz = pseries_memory_block_size();
> sections_per_block = block_sz / MIN_MEMORY_BLOCK_SIZE;
> - nid = memory_add_physaddr_to_nid(base);
>
> for (i = 0; i < sections_per_block; i++) {
> - __remove_memory(nid, base, MIN_MEMORY_BLOCK_SIZE);
> + __remove_memory(base, MIN_MEMORY_BLOCK_SIZE);
> base += MIN_MEMORY_BLOCK_SIZE;
> }
>
> @@ -386,7 +385,7 @@ static int dlpar_remove_lmb(struct drmem_lmb *lmb)
>
> block_sz = pseries_memory_block_size();
>
> - __remove_memory(mem_block->nid, lmb->base_addr, block_sz);
> + __remove_memory(lmb->base_addr, block_sz);
> put_device(&mem_block->dev);
>
> /* Update memory regions for memory remove */
> @@ -638,7 +637,7 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb)
>
> rc = dlpar_online_lmb(lmb);
> if (rc) {
> - __remove_memory(nid, lmb->base_addr, block_sz);
> + __remove_memory(lmb->base_addr, block_sz);
> invalidate_lmb_associativity_index(lmb);
> } else {
> lmb->flags |= DRCONF_MEM_ASSIGNED;
Acked-by: Michael Ellerman <mpe@ellerman•id.au> (powerpc)
cheers
next prev parent reply other threads:[~2021-06-08 11:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210607195430.48228-1-david@redhat.com>
2021-06-07 19:54 ` [PATCH v1 04/12] mm/memory_hotplug: remove nid parameter from arch_remove_memory() David Hildenbrand
2021-06-08 8:32 ` Catalin Marinas
2021-06-08 10:50 ` Michael Ellerman
2021-06-09 5:51 ` Heiko Carstens
2021-06-07 19:54 ` [PATCH v1 05/12] mm/memory_hotplug: remove nid parameter from remove_memory() and friends David Hildenbrand
2021-06-08 11:11 ` Michael Ellerman [this message]
2021-06-08 11:18 ` David Hildenbrand
2021-06-09 10:05 ` David Hildenbrand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y2bkehky.fsf@mpe.ellerman.id.au \
--to=mpe@ellerman$(echo .)id.au \
--cc=akpm@linux-foundation$(echo .)org \
--cc=aneesh.kumar@linux$(echo .)ibm.com \
--cc=anshuman.khandual@arm$(echo .)com \
--cc=cheloha@linux$(echo .)ibm.com \
--cc=dan.j.williams@intel$(echo .)com \
--cc=dave.hansen@linux$(echo .)intel.com \
--cc=dave.jiang@intel$(echo .)com \
--cc=david@redhat$(echo .)com \
--cc=jasowang@redhat$(echo .)com \
--cc=ldufour@linux$(echo .)ibm.com \
--cc=lenb@kernel$(echo .)org \
--cc=linux-acpi@vger$(echo .)kernel.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-mm@kvack$(echo .)org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=mhocko@kernel$(echo .)org \
--cc=mkedzier@redhat$(echo .)com \
--cc=mst@redhat$(echo .)com \
--cc=nathanl@linux$(echo .)ibm.com \
--cc=nvdimm@lists$(echo .)linux.dev \
--cc=osalvador@suse$(echo .)de \
--cc=pankaj.gupta.linux@gmail$(echo .)com \
--cc=pasha.tatashin@soleen$(echo .)com \
--cc=paulus@samba$(echo .)org \
--cc=richard.weiyang@linux$(echo .)alibaba.com \
--cc=rjw@rjwysocki$(echo .)net \
--cc=rppt@kernel$(echo .)org \
--cc=teawater@gmail$(echo .)com \
--cc=vbabka@suse$(echo .)cz \
--cc=virtualization@lists$(echo .)linux-foundation.org \
--cc=vishal.l.verma@intel$(echo .)com \
--cc=vkuznets@redhat$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox