Skip to content

Commit 24b21bb

Browse files
author
Fox Snowpatch
committed
1 parent 85ff933 commit 24b21bb

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

mm/hugetlb.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4836,6 +4836,11 @@ static int __init hugepages_setup(char *s)
48364836
unsigned long tmp;
48374837
char *p = s;
48384838

4839+
if (!hugepages_supported()) {
4840+
pr_warn("HugeTLB: hugepages unsupported, ignoring hugepages=%s cmdline\n", s);
4841+
return 0;
4842+
}
4843+
48394844
if (!parsed_valid_hugepagesz) {
48404845
pr_warn("HugeTLB: hugepages=%s does not follow a valid hugepagesz, ignoring\n", s);
48414846
parsed_valid_hugepagesz = true;
@@ -4916,6 +4921,11 @@ static int __init hugepagesz_setup(char *s)
49164921
unsigned long size;
49174922
struct hstate *h;
49184923

4924+
if (!hugepages_supported()) {
4925+
pr_warn("HugeTLB: hugepages unsupported, ignoring hugepagesz=%s cmdline\n", s);
4926+
return 0;
4927+
}
4928+
49194929
parsed_valid_hugepagesz = false;
49204930
size = (unsigned long)memparse(s, NULL);
49214931

@@ -4964,6 +4974,12 @@ static int __init default_hugepagesz_setup(char *s)
49644974
unsigned long size;
49654975
int i;
49664976

4977+
if (!hugepages_supported()) {
4978+
pr_warn("HugeTLB: hugepages unsupported, ignoring default_hugepagesz=%s cmdline\n",
4979+
s);
4980+
return 0;
4981+
}
4982+
49674983
parsed_valid_hugepagesz = false;
49684984
if (parsed_default_hugepagesz) {
49694985
pr_err("HugeTLB: default_hugepagesz previously specified, ignoring %s\n", s);

0 commit comments

Comments
 (0)