[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZkPOaAUZrRWRGke0@localhost.localdomain>
Date: Tue, 14 May 2024 22:49:44 +0200
From: Oscar Salvador <osalvador@...e.de>
To: Björn Töpel <bjorn@...nel.org>
Cc: Alexandre Ghiti <alexghiti@...osinc.com>,
Albert Ou <aou@...s.berkeley.edu>,
David Hildenbrand <david@...hat.com>,
Palmer Dabbelt <palmer@...belt.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
linux-riscv@...ts.infradead.org,
Björn Töpel <bjorn@...osinc.com>,
Andrew Bresticker <abrestic@...osinc.com>,
Chethan Seshadri <Chethan.Seshadri@...alinasystems.io>,
Lorenzo Stoakes <lstoakes@...il.com>,
Santosh Mamila <santosh.mamila@...alinasystems.io>,
Sivakumar Munnangi <siva.munnangi@...alinasystems.io>,
Sunil V L <sunilvl@...tanamicro.com>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, virtualization@...ts.linux-foundation.org
Subject: Re: [PATCH v2 4/8] riscv: mm: Add memory hotplugging support
On Tue, May 14, 2024 at 04:04:42PM +0200, Björn Töpel wrote:
> +static void __meminit free_vmemmap_storage(struct page *page, size_t size,
> + struct vmem_altmap *altmap)
> +{
> + if (altmap)
> + vmem_altmap_free(altmap, size >> PAGE_SHIFT);
> + else
> + free_pages((unsigned long)page_address(page), get_order(size));
David already pointed this out, but can check
arch/x86/mm/init_64.c:free_pagetable().
You will see that we have to do some magic for bootmem memory (DIMMs
which were not hotplugged but already present)
> +#ifdef CONFIG_SPARSEMEM_VMEMMAP
> +void __ref vmemmap_free(unsigned long start, unsigned long end, struct vmem_altmap *altmap)
> +{
> + remove_pgd_mapping(start, end, true, altmap);
> +}
> +#endif /* CONFIG_SPARSEMEM_VMEMMAP */
> +#endif /* CONFIG_MEMORY_HOTPLUG */
I will comment on the patch where you add support for hotplug and the
dependency, but on a track in LSFMM today, we decided that most likely
we will drop memory-hotplug support for !CONFIG_SPARSEMEM_VMEMMAP
environments.
So, since you are adding this plain fresh, please consider to tight the
hotplug dependency to CONFIG_SPARSEMEM_VMEMMAP.
As a bonus, you will only have to maintain one flavour of functions.
--
Oscar Salvador
SUSE Labs
Powered by blists - more mailing lists