Commit ac25ba68 authored by Aneesh Kumar K.V's avatar Aneesh Kumar K.V Committed by Michael Ellerman

powerpc/mm/hugetlb: Don't enable HugeTLB if we don't have a page table cache

This makes sure we don't enable HugeTLB if the cache is not configured.
I am still not sure about this. IMHO hugetlb support should be a hardware
support derivative and any cache allocation failure should be handled as I did
in the earlier patch. But then if we were not able to create hugetlb page table
cache, we can as well declare hugetlb support disabled thereby avoiding calling
into allocation routines.
Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 5d49275a
...@@ -601,6 +601,7 @@ __setup("hugepagesz=", hugepage_setup_sz); ...@@ -601,6 +601,7 @@ __setup("hugepagesz=", hugepage_setup_sz);
static int __init hugetlbpage_init(void) static int __init hugetlbpage_init(void)
{ {
bool configured = false;
int psize; int psize;
if (hugetlb_disabled) { if (hugetlb_disabled) {
...@@ -651,10 +652,15 @@ static int __init hugetlbpage_init(void) ...@@ -651,10 +652,15 @@ static int __init hugetlbpage_init(void)
pgtable_cache_add(pdshift - shift); pgtable_cache_add(pdshift - shift);
else if (IS_ENABLED(CONFIG_PPC_FSL_BOOK3E) || IS_ENABLED(CONFIG_PPC_8xx)) else if (IS_ENABLED(CONFIG_PPC_FSL_BOOK3E) || IS_ENABLED(CONFIG_PPC_8xx))
pgtable_cache_add(PTE_T_ORDER); pgtable_cache_add(PTE_T_ORDER);
configured = true;
} }
if (configured) {
if (IS_ENABLED(CONFIG_HUGETLB_PAGE_SIZE_VARIABLE)) if (IS_ENABLED(CONFIG_HUGETLB_PAGE_SIZE_VARIABLE))
hugetlbpage_init_default(); hugetlbpage_init_default();
} else
pr_info("Failed to initialize. Disabling HugeTLB");
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment