lkml.org 
[lkml]   [2021]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 1/5] mm,memory_hotplug: Allocate memmap from the added memory range
From
Date
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

\
 
 \ /
  Last update: 2021-03-18 13:07    [W:1.067 / U:2.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site