[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d1c59c27-6ca7-01df-8134-c896bbe7af85@redhat.com>
Date: Thu, 18 Mar 2021 13:05:39 +0100
From: David Hildenbrand <david@...hat.com>
To: Oscar Salvador <osalvador@...e.de>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Michal Hocko <mhocko@...nel.org>,
Anshuman Khandual <anshuman.khandual@....com>,
Vlastimil Babka <vbabka@...e.cz>,
Pavel Tatashin <pasha.tatashin@...een.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 1/5] mm,memory_hotplug: Allocate memmap from the added
memory range
On 18.03.21 13:03, Oscar Salvador wrote:
> On Thu, Mar 18, 2021 at 12:24:16PM +0100, David Hildenbrand wrote:
>> I don't follow. 2MB == 2MB. And if there would be difference then we would
>> be in the problem I brought up: vmemmap code allocating too much via the
>> altmap, which can be very bad because might be populating more vmemmap than
>> we actually need.
>
> Yes, I meant to say nr_vmemmap_pages won't match, or IOW, won't have the
> same meaning.
> The end result is the same.
>
>> vmemmap_size = 512 * 4KiB = 2 MiB.
>>
>> That calculation wasn't very useful (/ PAGE_SIZE * PAGE_SIZE)?
>
> Yeah, somewhat redundant.
>
>>
>>> unsigned long remaining_size = size - vmemmap_size;
>>
>> And here we could get something like
>>
>> remaining_size = 2 GiB - 2 MiB
>
> Yes, vmemmap_size would need to scale with nr_sections to be relative to
> size.
>
> Just wanted to bring it up, because somene might wonder
> "ok, why do we have altmap->nr_pfns = X, and here nr_vmemmap_pages
> is Y"
>
> It was an effort to make it consistent, although I see it would bring
> more confusion other than anything, so disregard.
I am also unhappy that we have to replicate the same computation at two
places, but I don't see an easy way to avoid that ... we have to trust
on vmemmap code to do the right thing either way :(
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists