Re: [PATCH 1/2] mm: remove pfn_valid_within() and CONFIG_HOLES_IN_ZONE

From: Zi Yan
Date: Tue Jul 13 2021 - 16:02:33 EST


On 13 Jul 2021, at 6:24, David Hildenbrand wrote:

> On 13.07.21 12:22, Mike Rapoport wrote:
>> On Tue, Jul 13, 2021 at 11:51:46AM +0200, David Hildenbrand wrote:
>>> On 13.07.21 10:00, Mike Rapoport wrote:
>>>> From: Mike Rapoport <rppt@xxxxxxxxxxxxx>
>>>>
>>>> After recent changes in freeing of the unused parts of the memory map and
>>>> rework of pfn_valid() in arm and arm64 there are no architectures that can
>>>> have holes in the memory map within a pageblock and so nothing can enable
>>>> CONFIG_HOLES_IN_ZONE which guards non trivial implementation of
>>>> pfn_valid_within().
>>>>
>>>> With that, pfn_valid_within() is always hardwired to 1 and can be
>>>> completely removed.
>>>>
>>>> Remove calls to pfn_valid_within() and CONFIG_HOLES_IN_ZONE.
>>>>
>>>> Signed-off-by: Mike Rapoport <rppt@xxxxxxxxxxxxx>
>>>
>>> There is currently the discussion to increase MAX_ORDER, for example, to
>>> cover 1GiB instead of 4MiB on x86-64. This would mean that we could
>>> suddenly, again, have holes insides MAX_ORDER - 1 pages.
>>>
>>> So I assume if we ever go down that path, we'll need something like this
>>> again.
>>
>> It depends whether pageblock_order will be also increased. PFN walkers rely
>> on continuity of pageblocks rather than MAX_ORDER chunks, so if
>> pageblock_order won't change, there won't be need to check for pfn_valid()
>> inside a pageblock.
>
> I'm pushing for letting pageblocks stay untouched, so good to know!
>
> (we still have this crazy special case of pageblocks > MAX_ORDER - 1 right now, which I think we should just eliminate)

I am working on this right now. After I increase MAX_ORDER above SECTION_SIZE_BITS,
holes can appear in a zone even on x86_64 and pfn_valid_within(), which is currently
set to 1, is needed to be pfn_valid(). That seems to be sufficient to make increasing
MAX_ORDER work.

For my use case, I might revive pfn_valid_within() if MAX_ORDER is configured to be
above SECTION_SIZE_BITS. Let me know if there is any better alternative. Thanks.


Best Regards,
Yan, Zi

Attachment: signature.asc
Description: OpenPGP digital signature