Subject: Re: [PATCH -V5 17/25] powerpc/THP: Implement transparent hugepages for ppc64

From: "Aneesh Kumar K.V" <[email-masked]>
Date: Fri, 12 Apr 2013 10:36:58 +0530

David Gibson <[email-masked]> writes:

> On Thu, Apr 11, 2013 at 01:10:29PM +0530, Aneesh Kumar K.V wrote:
>> David Gibson <[email-masked]> writes:
>> 
>> > On Thu, Apr 04, 2013 at 11:27:55AM +0530, Aneesh Kumar K.V wrote:
>> >> From: "Aneesh Kumar K.V" <[email-masked]>
>> >> 
>> >> We now have pmd entries covering to 16MB range. To implement THP on powerpc,
>> >> we double the size of PMD. The second half is used to deposit the pgtable (PTE page).
>> >> We also use the depoisted PTE page for tracking the HPTE information. The information
>> >> include [ secondary group | 3 bit hidx | valid ]. We use one byte per each HPTE entry.
>> >> With 16MB hugepage and 64K HPTE we need 256 entries and with 4K HPTE we need
>> >> 4096 entries. Both will fit in a 4K PTE page.
>> >> 
>> >> Signed-off-by: Aneesh Kumar K.V <[email-masked]>
>> >> ---
>> >>  arch/powerpc/include/asm/page.h              |    2 +-
>> >>  arch/powerpc/include/asm/pgtable-ppc64-64k.h |    3 +-
>> >>  arch/powerpc/include/asm/pgtable-ppc64.h     |    2 +-
>> >>  arch/powerpc/include/asm/pgtable.h           |  240 ++++++++++++++++++++
>> >>  arch/powerpc/mm/pgtable.c                    |  314 ++++++++++++++++++++++++++
>> >>  arch/powerpc/mm/pgtable_64.c                 |   13 ++
>> >>  arch/powerpc/platforms/Kconfig.cputype       |    1 +
>> >>  7 files changed, 572 insertions(+), 3 deletions(-)
>> >> 
>> >> diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
>> >> index 38e7ff6..b927447 100644
>> >> --- a/arch/powerpc/include/asm/page.h
>> >> +++ b/arch/powerpc/include/asm/page.h
>> >> @@ -40,7 +40,7 @@
>> >>  #ifdef CONFIG_HUGETLB_PAGE
>> >>  extern unsigned int HPAGE_SHIFT;
>> >>  #else
>> >> -#define HPAGE_SHIFT PAGE_SHIFT
>> >> +#define HPAGE_SHIFT PMD_SHIFT
>> >
>> > That looks like it could break everything except the 64k page size
>> > 64-bit base.
>> 
>> How about 
>
> It seems very dubious to me to have transparent hugepages enabled
> without explicit hugepages in the first place.
>

IMHO once we have THP, we will not be using explicit hugepages unless we
want 16GB pages.

-aneesh