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

Michael Ellerman mpe at ellerman.id.au
Tue Apr 11 20:25:41 AEST 2017


"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.

cheers


More information about the Linuxppc-dev mailing list