Commit c2833a5b authored by Mike Kravetz's avatar Mike Kravetz Committed by Linus Torvalds

hugetlbfs: fix changes to command line processing

Previously, a check for hugepages_supported was added before processing
hugetlb command line parameters.  On some architectures such as powerpc,
hugepages_supported() is not set to true until after command line
processing.  Therefore, no hugetlb command line parameters would be
accepted.

Remove the additional checks for hugepages_supported.  In hugetlb_init,
print a warning if !hugepages_supported and command line parameters were
specified.
Reported-by: default avatarSandipan Das <sandipan.osd@gmail.com>
Signed-off-by: default avatarMike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Link: http://lkml.kernel.org/r/b1f04f9f-fa46-c2a0-7693-4a0679d2a1ee@oracle.comSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 282f4214
...@@ -3212,8 +3212,11 @@ static int __init hugetlb_init(void) ...@@ -3212,8 +3212,11 @@ static int __init hugetlb_init(void)
{ {
int i; int i;
if (!hugepages_supported()) if (!hugepages_supported()) {
if (hugetlb_max_hstate || default_hstate_max_huge_pages)
pr_warn("HugeTLB: huge pages not supported, ignoring associated command-line parameters\n");
return 0; return 0;
}
/* /*
* Make sure HPAGE_SIZE (HUGETLB_PAGE_ORDER) hstate exists. Some * Make sure HPAGE_SIZE (HUGETLB_PAGE_ORDER) hstate exists. Some
...@@ -3315,11 +3318,6 @@ static int __init hugepages_setup(char *s) ...@@ -3315,11 +3318,6 @@ static int __init hugepages_setup(char *s)
unsigned long *mhp; unsigned long *mhp;
static unsigned long *last_mhp; static unsigned long *last_mhp;
if (!hugepages_supported()) {
pr_warn("HugeTLB: huge pages not supported, ignoring hugepages = %s\n", s);
return 0;
}
if (!parsed_valid_hugepagesz) { if (!parsed_valid_hugepagesz) {
pr_warn("HugeTLB: hugepages=%s does not follow a valid hugepagesz, ignoring\n", s); pr_warn("HugeTLB: hugepages=%s does not follow a valid hugepagesz, ignoring\n", s);
parsed_valid_hugepagesz = true; parsed_valid_hugepagesz = true;
...@@ -3372,11 +3370,6 @@ static int __init hugepagesz_setup(char *s) ...@@ -3372,11 +3370,6 @@ static int __init hugepagesz_setup(char *s)
struct hstate *h; struct hstate *h;
parsed_valid_hugepagesz = false; parsed_valid_hugepagesz = false;
if (!hugepages_supported()) {
pr_warn("HugeTLB: huge pages not supported, ignoring hugepagesz = %s\n", s);
return 0;
}
size = (unsigned long)memparse(s, NULL); size = (unsigned long)memparse(s, NULL);
if (!arch_hugetlb_valid_size(size)) { if (!arch_hugetlb_valid_size(size)) {
...@@ -3424,11 +3417,6 @@ static int __init default_hugepagesz_setup(char *s) ...@@ -3424,11 +3417,6 @@ static int __init default_hugepagesz_setup(char *s)
unsigned long size; unsigned long size;
parsed_valid_hugepagesz = false; parsed_valid_hugepagesz = false;
if (!hugepages_supported()) {
pr_warn("HugeTLB: huge pages not supported, ignoring default_hugepagesz = %s\n", s);
return 0;
}
if (parsed_default_hugepagesz) { if (parsed_default_hugepagesz) {
pr_err("HugeTLB: default_hugepagesz previously specified, ignoring %s\n", s); pr_err("HugeTLB: default_hugepagesz previously specified, ignoring %s\n", s);
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