diff mbox series

[v4,05/13] mm: Add __HAVE_ARCH_PUD_SAME similar to __HAVE_ARCH_P4D_SAME

Message ID 20230710160842.56300-6-aneesh.kumar@linux.ibm.com (mailing list archive)
State New
Headers show
Series Add support for DAX vmemmap optimization for ppc64 | expand

Commit Message

Aneesh Kumar K.V July 10, 2023, 4:08 p.m. UTC
This helps architectures to override pmd_same and pud_same independently.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
 include/linux/pgtable.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Christophe Leroy July 10, 2023, 5:29 p.m. UTC | #1
Le 10/07/2023 à 18:08, Aneesh Kumar K.V a écrit :
> This helps architectures to override pmd_same and pud_same independently.
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>

Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>

Shouldn't you do it the modern way and use #ifndef pud_same instead of a 
new __HAVE_ARCH_PUD_SAME like in the old days ?

> ---
>   include/linux/pgtable.h | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
> index 6fd9b2831338..91def34f7784 100644
> --- a/include/linux/pgtable.h
> +++ b/include/linux/pgtable.h
> @@ -693,7 +693,9 @@ static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b)
>   {
>   	return pmd_val(pmd_a) == pmd_val(pmd_b);
>   }
> +#endif
>   
> +#ifndef __HAVE_ARCH_PUD_SAME
>   static inline int pud_same(pud_t pud_a, pud_t pud_b)
>   {
>   	return pud_val(pud_a) == pud_val(pud_b);
Aneesh Kumar K.V July 11, 2023, 4:24 a.m. UTC | #2
Christophe Leroy <christophe.leroy@csgroup.eu> writes:

> Le 10/07/2023 à 18:08, Aneesh Kumar K.V a écrit :
>> This helps architectures to override pmd_same and pud_same independently.
>> 
>> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
>
> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>
> Shouldn't you do it the modern way and use #ifndef pud_same instead of a 
> new __HAVE_ARCH_PUD_SAME like in the old days ?
>

Sure will update. I was following existing pmd_same override. But I also
agree #ifndef pud_same is better.



>
>> ---
>>   include/linux/pgtable.h | 2 ++
>>   1 file changed, 2 insertions(+)
>> 
>> diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
>> index 6fd9b2831338..91def34f7784 100644
>> --- a/include/linux/pgtable.h
>> +++ b/include/linux/pgtable.h
>> @@ -693,7 +693,9 @@ static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b)
>>   {
>>   	return pmd_val(pmd_a) == pmd_val(pmd_b);
>>   }
>> +#endif
>>   
>> +#ifndef __HAVE_ARCH_PUD_SAME
>>   static inline int pud_same(pud_t pud_a, pud_t pud_b)
>>   {
>>   	return pud_val(pud_a) == pud_val(pud_b);

-aneesh
diff mbox series

Patch

diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
index 6fd9b2831338..91def34f7784 100644
--- a/include/linux/pgtable.h
+++ b/include/linux/pgtable.h
@@ -693,7 +693,9 @@  static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b)
 {
 	return pmd_val(pmd_a) == pmd_val(pmd_b);
 }
+#endif
 
+#ifndef __HAVE_ARCH_PUD_SAME
 static inline int pud_same(pud_t pud_a, pud_t pud_b)
 {
 	return pud_val(pud_a) == pud_val(pud_b);