[PATCH v3 1/2] book3s64/radix: Fix compile errors when CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP=n

Ritesh Harjani (IBM) ritesh.list at gmail.com
Tue Mar 11 01:19:06 AEDT 2025


Christophe Leroy <christophe.leroy at csgroup.eu> writes:

> Le 10/03/2025 à 13:44, Donet Tom a écrit :
>> From: "Ritesh Harjani (IBM)" <ritesh.list at gmail.com>
>> 
>> Fix compile errors when CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP=n
>
> I don't understand your patch.
>
> As far as I can see, CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP is selected 
> when CONFIG_PPC_RADIX_MMU is selected, and radix_pgtable.o is built only 
> when CONFIG_PPC_RADIX_MMU is selected. So when radix_pgtable.o is built 
> CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP will always be selected.
>
> Can you clarify what the problem is ?
>

You are right CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP always gets enabled
by default for radix mmu. However, when we forcefully wanted to test the
!vmemmap_can_optimize() path in radix, we forcefully removed the support
of ARCH_WANT_OPTIMIZE_DAX_VMEMMAP from arch/powerpc/Kconfig (by making
the kernel change). That is when we were facing the compilation errors
due to duplicate definition of vmemmap_can_optimize(). 

The other one is defined in include/linux/mm.h under #ifdef
CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP and #else.

So it is only a good to have patch.

-ritesh

> Christophe
>
>> 
>> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list at gmail.com>
>> Signed-off-by: Donet Tom <donettom at linux.ibm.com>
>> ---
>>   arch/powerpc/mm/book3s64/radix_pgtable.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>> 
>> diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c
>> index 311e2112d782..bd6916419472 100644
>> --- a/arch/powerpc/mm/book3s64/radix_pgtable.c
>> +++ b/arch/powerpc/mm/book3s64/radix_pgtable.c
>> @@ -976,7 +976,7 @@ int __meminit radix__vmemmap_create_mapping(unsigned long start,
>>   	return 0;
>>   }
>>   
>> -
>> +#ifdef CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP
>>   bool vmemmap_can_optimize(struct vmem_altmap *altmap, struct dev_pagemap *pgmap)
>>   {
>>   	if (radix_enabled())
>> @@ -984,6 +984,7 @@ bool vmemmap_can_optimize(struct vmem_altmap *altmap, struct dev_pagemap *pgmap)
>>   
>>   	return false;
>>   }
>> +#endif
>>   
>>   int __meminit vmemmap_check_pmd(pmd_t *pmdp, int node,
>>   				unsigned long addr, unsigned long next)


More information about the Linuxppc-dev mailing list