[RFC PATCH 6/7] powerpc/hugetlb: Add code to support to follow huge page directory entries

Anshuman Khandual khandual at linux.vnet.ibm.com
Wed Apr 12 14:48:19 AEST 2017


On 04/11/2017 03:55 PM, Michael Ellerman wrote:
> "Aneesh Kumar K.V" <aneesh.kumar at linux.vnet.ibm.com> writes:
> 
>> Add follow_huge_pd implementation for ppc64.
>>
>> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar at linux.vnet.ibm.com>
>> ---
>>  arch/powerpc/mm/hugetlbpage.c | 42 ++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 42 insertions(+)
>>
>> diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
>> index 80f6d2ed551a..9d66d4f810aa 100644
>> --- a/arch/powerpc/mm/hugetlbpage.c
>> +++ b/arch/powerpc/mm/hugetlbpage.c
>> @@ -17,6 +17,8 @@
>>  #include <linux/memblock.h>
>>  #include <linux/bootmem.h>
>>  #include <linux/moduleparam.h>
>> +#include <linux/swap.h>
>> +#include <linux/swapops.h>
>>  #include <asm/pgtable.h>
>>  #include <asm/pgalloc.h>
>>  #include <asm/tlb.h>
>> @@ -618,6 +620,10 @@ void hugetlb_free_pgd_range(struct mmu_gather *tlb,
>>  }
>>  
>>  /*
>> + * 64 bit book3s use generic follow_page_mask
>> + */
>> +#ifndef CONFIG_PPC_BOOK3S_64
> I think it's always easier to follow if you use:
> 
>   #ifdef x
>   ...
>   #else /* !x */
>   ...
>   #endif
> 
> ie. in this case put the Book3S 64 case first and the existing code in the
> #else.

Yeah, it was difficult to read in the first glance.



More information about the Linuxppc-dev mailing list