From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: David Gibson <dwg@au1.ibm.com>
Cc: paulus@samba.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org
Subject: Re: [PATCH -V7 08/10] powerpc/THP: Enable THP on PPC64
Date: Sat, 04 May 2013 00:19:03 +0530 [thread overview]
Message-ID: <87r4hn5274.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <20130503051528.GT13041@truffula.fritz.box>
David Gibson <dwg@au1.ibm.com> writes:
> On Mon, Apr 29, 2013 at 01:21:49AM +0530, Aneesh Kumar K.V wrote:
>> From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
>>
>> We enable only if the we support 16MB page size.
>>
>> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
>> ---
>> arch/powerpc/include/asm/pgtable-ppc64.h | 3 +--
>> arch/powerpc/mm/pgtable_64.c | 28 ++++++++++++++++++++++++++++
>> 2 files changed, 29 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h
>> index 97fc839..d65534b 100644
>> --- a/arch/powerpc/include/asm/pgtable-ppc64.h
>> +++ b/arch/powerpc/include/asm/pgtable-ppc64.h
>> @@ -426,8 +426,7 @@ static inline unsigned long pmd_pfn(pmd_t pmd)
>> return pmd_val(pmd) >> PTE_RPN_SHIFT;
>> }
>>
>> -/* We will enable it in the last patch */
>> -#define has_transparent_hugepage() 0
>> +extern int has_transparent_hugepage(void);
>> #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
>>
>> static inline int pmd_young(pmd_t pmd)
>> diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
>> index 54216c1..b742d6f 100644
>> --- a/arch/powerpc/mm/pgtable_64.c
>> +++ b/arch/powerpc/mm/pgtable_64.c
>> @@ -754,6 +754,34 @@ void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr,
>> return;
>> }
>>
>> +int has_transparent_hugepage(void)
>> +{
>> + if (!mmu_has_feature(MMU_FTR_16M_PAGE))
>> + return 0;
>> + /*
>> + * We support THP only if HPAGE_SHIFT is 16MB.
>> + */
>> + if (!HPAGE_SHIFT || (HPAGE_SHIFT != mmu_psize_defs[MMU_PAGE_16M].shift))
>> + return 0;
>
> Again, THP should not be dependent on the value of HPAGE_SHIFT. Just
> checking that mmu_psize_defsz[MMU_PAGE_16M].shift == 24 should be
> sufficient (i.e. that 16M hugepages are supported).
done
+ /*
+ * We support THP only if PMD_SIZE is 16MB.
+ */
+ if (mmu_psize_defs[MMU_PAGE_16M].shift != PMD_SHIFT)
+ return 0;
+ /*
>
>> + /*
>> + * We need to make sure that we support 16MB hugepage in a segement
>> + * with base page size 64K or 4K. We only enable THP with a PAGE_SIZE
>> + * of 64K.
>> + */
>> + /*
>> + * If we have 64K HPTE, we will be using that by default
>> + */
>> + if (mmu_psize_defs[MMU_PAGE_64K].shift &&
>> + (mmu_psize_defs[MMU_PAGE_64K].penc[MMU_PAGE_16M] == -1))
>> + return 0;
>> + /*
>> + * Ok we only have 4K HPTE
>> + */
>> + if (mmu_psize_defs[MMU_PAGE_4K].penc[MMU_PAGE_16M] == -1)
>> + return 0;
>
> Except you don't actually support THP on 4K base page size yet.
That is 64K linux page size and 4K HPTE . We do support that. The Linux
page size part is taken care by Kconfig.
>
>> +
>> + return 1;
>> +}
>> #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
>>
>> pmd_t pmdp_get_and_clear(struct mm_struct *mm,
>
-aneesh
WARNING: multiple messages have this Message-ID (diff)
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: David Gibson <dwg@au1.ibm.com>
Cc: benh@kernel.crashing.org, paulus@samba.org, linux-mm@kvack.org,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH -V7 08/10] powerpc/THP: Enable THP on PPC64
Date: Sat, 04 May 2013 00:19:03 +0530 [thread overview]
Message-ID: <87r4hn5274.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <20130503051528.GT13041@truffula.fritz.box>
David Gibson <dwg@au1.ibm.com> writes:
> On Mon, Apr 29, 2013 at 01:21:49AM +0530, Aneesh Kumar K.V wrote:
>> From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
>>
>> We enable only if the we support 16MB page size.
>>
>> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
>> ---
>> arch/powerpc/include/asm/pgtable-ppc64.h | 3 +--
>> arch/powerpc/mm/pgtable_64.c | 28 ++++++++++++++++++++++++++++
>> 2 files changed, 29 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h
>> index 97fc839..d65534b 100644
>> --- a/arch/powerpc/include/asm/pgtable-ppc64.h
>> +++ b/arch/powerpc/include/asm/pgtable-ppc64.h
>> @@ -426,8 +426,7 @@ static inline unsigned long pmd_pfn(pmd_t pmd)
>> return pmd_val(pmd) >> PTE_RPN_SHIFT;
>> }
>>
>> -/* We will enable it in the last patch */
>> -#define has_transparent_hugepage() 0
>> +extern int has_transparent_hugepage(void);
>> #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
>>
>> static inline int pmd_young(pmd_t pmd)
>> diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
>> index 54216c1..b742d6f 100644
>> --- a/arch/powerpc/mm/pgtable_64.c
>> +++ b/arch/powerpc/mm/pgtable_64.c
>> @@ -754,6 +754,34 @@ void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr,
>> return;
>> }
>>
>> +int has_transparent_hugepage(void)
>> +{
>> + if (!mmu_has_feature(MMU_FTR_16M_PAGE))
>> + return 0;
>> + /*
>> + * We support THP only if HPAGE_SHIFT is 16MB.
>> + */
>> + if (!HPAGE_SHIFT || (HPAGE_SHIFT != mmu_psize_defs[MMU_PAGE_16M].shift))
>> + return 0;
>
> Again, THP should not be dependent on the value of HPAGE_SHIFT. Just
> checking that mmu_psize_defsz[MMU_PAGE_16M].shift == 24 should be
> sufficient (i.e. that 16M hugepages are supported).
done
+ /*
+ * We support THP only if PMD_SIZE is 16MB.
+ */
+ if (mmu_psize_defs[MMU_PAGE_16M].shift != PMD_SHIFT)
+ return 0;
+ /*
>
>> + /*
>> + * We need to make sure that we support 16MB hugepage in a segement
>> + * with base page size 64K or 4K. We only enable THP with a PAGE_SIZE
>> + * of 64K.
>> + */
>> + /*
>> + * If we have 64K HPTE, we will be using that by default
>> + */
>> + if (mmu_psize_defs[MMU_PAGE_64K].shift &&
>> + (mmu_psize_defs[MMU_PAGE_64K].penc[MMU_PAGE_16M] == -1))
>> + return 0;
>> + /*
>> + * Ok we only have 4K HPTE
>> + */
>> + if (mmu_psize_defs[MMU_PAGE_4K].penc[MMU_PAGE_16M] == -1)
>> + return 0;
>
> Except you don't actually support THP on 4K base page size yet.
That is 64K linux page size and 4K HPTE . We do support that. The Linux
page size part is taken care by Kconfig.
>
>> +
>> + return 1;
>> +}
>> #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
>>
>> pmd_t pmdp_get_and_clear(struct mm_struct *mm,
>
-aneesh
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2013-05-03 18:49 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-28 19:51 [PATCH -V7 00/10] THP support for PPC64 (Patchset 2) Aneesh Kumar K.V
2013-04-28 19:51 ` Aneesh Kumar K.V
2013-04-28 19:51 ` [PATCH -V7 01/10] powerpc/THP: Double the PMD table size for THP Aneesh Kumar K.V
2013-04-28 19:51 ` Aneesh Kumar K.V
2013-05-03 3:21 ` David Gibson
2013-05-03 3:21 ` David Gibson
2013-04-28 19:51 ` [PATCH -V7 02/10] powerpc/THP: Implement transparent hugepages for ppc64 Aneesh Kumar K.V
2013-04-28 19:51 ` Aneesh Kumar K.V
2013-05-03 4:52 ` David Gibson
2013-05-03 4:52 ` David Gibson
2013-05-03 8:19 ` Benjamin Herrenschmidt
2013-05-03 8:19 ` Benjamin Herrenschmidt
2013-05-03 11:54 ` David Gibson
2013-05-03 11:54 ` David Gibson
2013-05-03 13:00 ` Benjamin Herrenschmidt
2013-05-03 13:00 ` Benjamin Herrenschmidt
2013-05-03 18:54 ` Aneesh Kumar K.V
2013-05-03 18:54 ` Aneesh Kumar K.V
2013-05-04 19:14 ` Aneesh Kumar K.V
2013-05-04 19:14 ` Aneesh Kumar K.V
2013-05-04 21:39 ` Benjamin Herrenschmidt
2013-05-04 21:39 ` Benjamin Herrenschmidt
2013-05-06 1:28 ` David Gibson
2013-05-06 1:28 ` David Gibson
2013-04-28 19:51 ` [PATCH -V7 03/10] powerpc: move find_linux_pte_or_hugepte and gup_hugepte to common code Aneesh Kumar K.V
2013-04-28 19:51 ` Aneesh Kumar K.V
2013-04-28 19:51 ` [PATCH -V7 04/10] powerpc: Update find_linux_pte_or_hugepte to handle transparent hugepages Aneesh Kumar K.V
2013-04-28 19:51 ` Aneesh Kumar K.V
2013-05-03 4:53 ` David Gibson
2013-05-03 4:53 ` David Gibson
2013-05-03 18:58 ` Aneesh Kumar K.V
2013-05-03 18:58 ` Aneesh Kumar K.V
2013-05-04 6:28 ` David Gibson
2013-05-04 6:28 ` David Gibson
2013-04-28 19:51 ` [PATCH -V7 05/10] powerpc: Replace find_linux_pte with find_linux_pte_or_hugepte Aneesh Kumar K.V
2013-04-28 19:51 ` Aneesh Kumar K.V
2013-05-03 4:56 ` David Gibson
2013-05-03 4:56 ` David Gibson
2013-04-28 19:51 ` [PATCH -V7 06/10] powerpc: Update gup_pmd_range to handle transparent hugepages Aneesh Kumar K.V
2013-04-28 19:51 ` Aneesh Kumar K.V
2013-05-03 4:57 ` David Gibson
2013-05-03 4:57 ` David Gibson
2013-04-28 19:51 ` [PATCH -V7 07/10] powerpc/THP: Add code to handle HPTE faults for large pages Aneesh Kumar K.V
2013-04-28 19:51 ` Aneesh Kumar K.V
2013-05-03 5:13 ` David Gibson
2013-05-03 5:13 ` David Gibson
2013-04-28 19:51 ` [PATCH -V7 08/10] powerpc/THP: Enable THP on PPC64 Aneesh Kumar K.V
2013-04-28 19:51 ` Aneesh Kumar K.V
2013-05-03 5:15 ` David Gibson
2013-05-03 5:15 ` David Gibson
2013-05-03 18:49 ` Aneesh Kumar K.V [this message]
2013-05-03 18:49 ` Aneesh Kumar K.V
2013-05-05 8:59 ` David Gibson
2013-05-05 8:59 ` David Gibson
2013-04-28 19:51 ` [PATCH -V7 09/10] powerpc: Optimize hugepage invalidate Aneesh Kumar K.V
2013-04-28 19:51 ` Aneesh Kumar K.V
2013-05-03 5:28 ` David Gibson
2013-05-03 5:28 ` David Gibson
2013-05-03 19:05 ` Aneesh Kumar K.V
2013-05-03 19:05 ` Aneesh Kumar K.V
2013-05-03 21:54 ` Benjamin Herrenschmidt
2013-05-03 21:54 ` Benjamin Herrenschmidt
2013-04-28 19:51 ` [PATCH -V7 10/10] powerpc: disable assert_pte_locked Aneesh Kumar K.V
2013-04-28 19:51 ` Aneesh Kumar K.V
2013-05-03 5:30 ` David Gibson
2013-05-03 5:30 ` David Gibson
2013-05-03 19:07 ` Aneesh Kumar K.V
2013-05-03 19:07 ` Aneesh Kumar K.V
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r4hn5274.fsf@linux.vnet.ibm.com \
--to=aneesh.kumar@linux.vnet.ibm.com \
--cc=dwg@au1.ibm.com \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.