* [PATCH] powerpc/mm: Disable registering 16G hugepage size for powernv platform
@ 2017-07-24 7:26 Aneesh Kumar K.V
2017-07-24 10:28 ` Michael Ellerman
0 siblings, 1 reply; 3+ messages in thread
From: Aneesh Kumar K.V @ 2017-07-24 7:26 UTC (permalink / raw)
To: benh, paulus, mpe; +Cc: linuxppc-dev, Aneesh Kumar K.V
We don't support allocating them runtime. Only supported mechanism as of now is
HMC based hypervisor interface. So disable 16G hugetlb on powernv platform
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
May be this should go to -stable ?. To show the 16G pagesize in
/sys/kernel/mm/hugepages/ confuse users
arch/powerpc/mm/hugetlbpage.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index e1bf5ca397fe..28ea94da0707 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -24,6 +24,7 @@
#include <asm/tlb.h>
#include <asm/setup.h>
#include <asm/hugetlb.h>
+#include <asm/machdep.h>
#ifdef CONFIG_HUGETLB_PAGE
@@ -749,7 +750,8 @@ static int __init add_huge_page_size(unsigned long long size)
return -EINVAL;
}
} else {
- if (mmu_psize != MMU_PAGE_16M && mmu_psize != MMU_PAGE_16G)
+ if ((mmu_psize != MMU_PAGE_16M && mmu_psize != MMU_PAGE_16G)
+ || (mmu_psize == MMU_PAGE_16G && machine_is(powernv)))
return -EINVAL;
}
#endif
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc/mm: Disable registering 16G hugepage size for powernv platform
2017-07-24 7:26 [PATCH] powerpc/mm: Disable registering 16G hugepage size for powernv platform Aneesh Kumar K.V
@ 2017-07-24 10:28 ` Michael Ellerman
2017-07-25 5:07 ` Aneesh Kumar K.V
0 siblings, 1 reply; 3+ messages in thread
From: Michael Ellerman @ 2017-07-24 10:28 UTC (permalink / raw)
To: Aneesh Kumar K.V, benh, paulus; +Cc: linuxppc-dev, Aneesh Kumar K.V
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> writes:
> We don't support allocating them runtime. Only supported mechanism as of now is
> HMC based hypervisor interface. So disable 16G hugetlb on powernv platform
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
>
> May be this should go to -stable ?. To show the 16G pagesize in
> /sys/kernel/mm/hugepages/ confuse users
It's a bit of a hack :/
16G also shows up on pseries, when there are no pages pre-allocated,
which is also confusing.
Ideally we'd only show sizes that can be allocated at runtime, OR were
preallocated, regardless of platform.
Is there an easy way to do that?
cheers
> arch/powerpc/mm/hugetlbpage.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
> index e1bf5ca397fe..28ea94da0707 100644
> --- a/arch/powerpc/mm/hugetlbpage.c
> +++ b/arch/powerpc/mm/hugetlbpage.c
> @@ -24,6 +24,7 @@
> #include <asm/tlb.h>
> #include <asm/setup.h>
> #include <asm/hugetlb.h>
> +#include <asm/machdep.h>
>
> #ifdef CONFIG_HUGETLB_PAGE
>
> @@ -749,7 +750,8 @@ static int __init add_huge_page_size(unsigned long long size)
> return -EINVAL;
> }
> } else {
> - if (mmu_psize != MMU_PAGE_16M && mmu_psize != MMU_PAGE_16G)
> + if ((mmu_psize != MMU_PAGE_16M && mmu_psize != MMU_PAGE_16G)
> + || (mmu_psize == MMU_PAGE_16G && machine_is(powernv)))
> return -EINVAL;
> }
> #endif
> --
> 2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc/mm: Disable registering 16G hugepage size for powernv platform
2017-07-24 10:28 ` Michael Ellerman
@ 2017-07-25 5:07 ` Aneesh Kumar K.V
0 siblings, 0 replies; 3+ messages in thread
From: Aneesh Kumar K.V @ 2017-07-25 5:07 UTC (permalink / raw)
To: linuxppc-dev
On 07/24/2017 03:58 PM, Michael Ellerman wrote:
> "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> writes:
>
>> We don't support allocating them runtime. Only supported mechanism as of now is
>> HMC based hypervisor interface. So disable 16G hugetlb on powernv platform
>>
>> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
>> ---
>>
>> May be this should go to -stable ?. To show the 16G pagesize in
>> /sys/kernel/mm/hugepages/ confuse users
> It's a bit of a hack :/
>
> 16G also shows up on pseries, when there are no pages pre-allocated,
> which is also confusing.
>
> Ideally we'd only show sizes that can be allocated at runtime, OR were
> preallocated, regardless of platform.
>
> Is there an easy way to do that?
>
>
That is tricky, we are are going to enable 16G hugetlb on powernv with a
followup patch. In that series we depend on the specifying hugetlb page
count via kernel command line. The way above kernel command line parsing
work is by looking at the hugetlb hstate which got allocated before and
then assign the number of hugepages to that hstate. What you are asking
is to fail the creating of hstate based on number of hugepages.
For now there is no way of using 16G hugepage on powernv. This patch
address that issue by not showing 16G as a supported hugetlb page. In
the later series, we will enable 16G hugetlb for powernv
and at which point both pseries and powernv behavior will remain consistent.
-aneesh
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-07-25 5:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-24 7:26 [PATCH] powerpc/mm: Disable registering 16G hugepage size for powernv platform Aneesh Kumar K.V
2017-07-24 10:28 ` Michael Ellerman
2017-07-25 5:07 ` Aneesh Kumar K.V
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox