Re: [PATCH] mm/thp: Define default pmd_pgtable()

From: Anshuman Khandual
Date: Tue Jun 08 2021 - 03:48:22 EST




On 6/8/21 12:28 PM, Geert Uytterhoeven wrote:
> Hi Anshuman,
>
> On Tue, Jun 8, 2021 at 7:31 AM Anshuman Khandual
> <anshuman.khandual@xxxxxxx> wrote:
>> Currently most platforms define pmd_pgtable() as pmd_page() duplicating the
>> same code all over. Instead just define a default value i.e pmd_page() for
>> pmd_pgtable() and let platforms override when required via <asm/pgtable.h>.
>> All the existing platform that override pmd_pgtable() have been moved into
>> their respective <asm/pgtable.h> header in order to precede before the new
>> generic definition. This makes it much cleaner with reduced code.
>> Signed-off-by: Anshuman Khandual <anshuman.khandual@xxxxxxx>
> Thanks for your patch!
>
>> This patch has been built tested across multiple platforms. But the m68k
>> changes in particular might not be optimal, followed the existing switch
>> from (arch/m68k/include/asm/pgalloc.h).
> Indeed. Why not move them to the existing
> arch/m68k/asm/{sun3,mcf,motorola}_pgtable.h>, instead of introducing
> yet another #if/#elif/#else/#endif block?
>

Yes, that works. Will change.