[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87msork4x0.fsf@all.your.base.are.belong.to.us>
Date: Wed, 15 May 2024 07:41:47 +0200
From: Björn Töpel <bjorn@...nel.org>
To: Oscar Salvador <osalvador@...e.de>
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
Oscar Salvador <osalvador@...e.de> writes:
> 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)
Thank you!
>> +#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.
Ah, yeah, I saw it mentioned on the LSF/MM/BPF topics. Less is
definitely more -- I'll make the next version depend on
SPARSEMEM_VMEMMAP.
Björn
Powered by blists - more mailing lists