diff mbox

powerpc/mm/hugetlb: Don't panic if we don't find the default huge page size

Message ID 20161213140411.20633-1-aneesh.kumar@linux.vnet.ibm.com (mailing list archive)
State Accepted
Headers show

Commit Message

Aneesh Kumar K.V Dec. 13, 2016, 2:04 p.m. UTC
generic hugetlbfs can handle that condition correctly. With HPAGE_SHIFT = 0
we get
[0.241333] hugetlbfs: disabling because there are no supported hugepage sizes

bash-4.2# echo 30 > /proc/sys/vm/nr_hugepages
bash: echo: write error: Operation not supported

Fixes: "powerpc: get hugetlbpage handling more generic"
Reported-by: Chris Smart <csmart@ozlabs.au.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 arch/powerpc/mm/hugetlbpage.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Michael Neuling Jan. 4, 2017, 12:18 a.m. UTC | #1
On Tue, 2016-12-13 at 19:34 +0530, Aneesh Kumar K.V wrote:
> generic hugetlbfs can handle that condition correctly. With HPAGE_SHIFT = 0
> we get
> [0.241333] hugetlbfs: disabling because there are no supported hugepage sizes
> 
> bash-4.2# echo 30 > /proc/sys/vm/nr_hugepages
> bash: echo: write error: Operation not supported
> 
> Fixes: "powerpc: get hugetlbpage handling more generic"
> Reported-by: Chris Smart <csmart@ozlabs.au.ibm.com>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

Acked-By: Michael Neuling <mikey@neuling.org>

> ---
>  arch/powerpc/mm/hugetlbpage.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
> index 289df38fb7e0..e46bbd716832 100644
> --- a/arch/powerpc/mm/hugetlbpage.c
> +++ b/arch/powerpc/mm/hugetlbpage.c
> @@ -852,9 +852,6 @@ static int __init hugetlbpage_init(void)
>  	else if (mmu_psize_defs[MMU_PAGE_2M].shift)
>  		HPAGE_SHIFT = mmu_psize_defs[MMU_PAGE_2M].shift;
>  #endif
> -	else
> -		panic("%s: Unable to set default huge page size\n",
> __func__);
> -
>  	return 0;
>  }
>
Anshuman Khandual Jan. 16, 2017, 6:55 a.m. UTC | #2
On 12/13/2016 07:34 PM, Aneesh Kumar K.V wrote:
> generic hugetlbfs can handle that condition correctly. With HPAGE_SHIFT = 0

Need to add some context here. "That condition" refers to something without
first mentioning it.

> we get
> [0.241333] hugetlbfs: disabling because there are no supported hugepage sizes
> 
> bash-4.2# echo 30 > /proc/sys/vm/nr_hugepages
> bash: echo: write error: Operation not supported
> 
> Fixes: "powerpc: get hugetlbpage handling more generic"

Dont we need the commit SHA for the "Fixes" header ?
Aneesh Kumar K.V Jan. 16, 2017, 4:42 p.m. UTC | #3
Anshuman Khandual <khandual@linux.vnet.ibm.com> writes:

> On 12/13/2016 07:34 PM, Aneesh Kumar K.V wrote:
>> generic hugetlbfs can handle that condition correctly. With HPAGE_SHIFT = 0
>
> Need to add some context here. "That condition" refers to something without
> first mentioning it.

It is the conditinal statement that gets removed as part of this patch.
The next line also explains what the generic code does for that condition.
>
>> we get
>> [0.241333] hugetlbfs: disabling because there are no supported hugepage sizes
>> 
>> bash-4.2# echo 30 > /proc/sys/vm/nr_hugepages
>> bash: echo: write error: Operation not supported
>> 
>> Fixes: "powerpc: get hugetlbpage handling more generic"
>
> Dont we need the commit SHA for the "Fixes" header ?

When I wrote the patch, the commit was not upstream. Hence i didn't had
an SHA1 to put there.

-aneesh
Michael Ellerman Jan. 18, 2017, 12:10 p.m. UTC | #4
On Tue, 2016-12-13 at 14:04:11 UTC, "Aneesh Kumar K.V" wrote:
> generic hugetlbfs can handle that condition correctly. With HPAGE_SHIFT = 0
> we get
> [0.241333] hugetlbfs: disabling because there are no supported hugepage sizes
> 
> bash-4.2# echo 30 > /proc/sys/vm/nr_hugepages
> bash: echo: write error: Operation not supported
> 
> Fixes: "powerpc: get hugetlbpage handling more generic"
> Reported-by: Chris Smart <csmart@ozlabs.au.ibm.com>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> Acked-By: Michael Neuling <mikey@neuling.org>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/ff8b85796dad5de869dc29903c9566

cheers
diff mbox

Patch

diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 289df38fb7e0..e46bbd716832 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -852,9 +852,6 @@  static int __init hugetlbpage_init(void)
 	else if (mmu_psize_defs[MMU_PAGE_2M].shift)
 		HPAGE_SHIFT = mmu_psize_defs[MMU_PAGE_2M].shift;
 #endif
-	else
-		panic("%s: Unable to set default huge page size\n", __func__);
-
 	return 0;
 }