[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d02e77cf-fd23-2ccd-612e-b857a8140a1c@redhat.com>
Date: Mon, 1 Mar 2021 09:30:17 +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>, VlastimilBabkavbabka@...e.cz,
pasha.tatashin@...een.com, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, Anshuman Khandual <anshuman.khandual@....com>
Subject: Re: [PATCH v2 1/7] mm,memory_hotplug: Allocate memmap from the added
memory range
>>> + (*online_page_callback)(pfn_to_page(pfn), pageblock_order);
>>> + pfn += 1 << pageblock_order;
>>
>> pfn += pageblock_nr_pages;
>>
>> Can you add a comment why we can be sure that we are off by a single pageblock? What about s390x where a MAX_ORDER_NR_PAGES == 4 * pageblock_nr_pages?
>>
>> Would it make thing simpler to just do a
>>
>> while (!IS_ALIGNED(pfn, MAX_ORDER_NR_PAGES)) {
>> (*online_page_callback)(pfn_to_page(pfn), 0);
>> pfn++;
>> }
>
> Honestly, I did not spend much time thinking on other platforms other
> than arm64/x86_64.
> But I think that that would be the universal solution as we do not make
> any assumptions.
>
> I will replace it.
I think you could also go with
while (!IS_ALIGNED(pfn, MAX_ORDER_NR_PAGES)) {
(*online_page_callback)(pfn_to_page(pfn), pageblock_order);
pageblock_nr_pages;
}
And maybe add a comment why we can be sure it has to be aligned to
pageblocks. Or maybe rather add
VM_BUG_ON(IS_ALIGNED(pfn, pageblock_nr_pages));
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists