diff options
author | Andrea Arcangeli <aarcange@redhat.com> | 2011-01-13 18:47:09 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 20:32:45 -0500 |
commit | 4b7167b9ff9b7f3f528cbc4c7d02ebd275b9b10c (patch) | |
tree | ad2c23c28b9dea009daf3719aefeb79103e2c152 /mm/huge_memory.c | |
parent | 94fcc585fb85ad7b059c70872489b50044d401f3 (diff) |
thp: don't allow transparent hugepage support without PSE
Archs implementing Transparent Hugepage Support must implement a function
called has_transparent_hugepage to be sure the virtual or physical CPU
supports Transparent Hugepages.
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/huge_memory.c')
-rw-r--r-- | mm/huge_memory.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c index b6facc35e893..915809b16edf 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c | |||
@@ -487,7 +487,15 @@ static int __init hugepage_init(void) | |||
487 | int err; | 487 | int err; |
488 | #ifdef CONFIG_SYSFS | 488 | #ifdef CONFIG_SYSFS |
489 | static struct kobject *hugepage_kobj; | 489 | static struct kobject *hugepage_kobj; |
490 | #endif | ||
490 | 491 | ||
492 | err = -EINVAL; | ||
493 | if (!has_transparent_hugepage()) { | ||
494 | transparent_hugepage_flags = 0; | ||
495 | goto out; | ||
496 | } | ||
497 | |||
498 | #ifdef CONFIG_SYSFS | ||
491 | err = -ENOMEM; | 499 | err = -ENOMEM; |
492 | hugepage_kobj = kobject_create_and_add("transparent_hugepage", mm_kobj); | 500 | hugepage_kobj = kobject_create_and_add("transparent_hugepage", mm_kobj); |
493 | if (unlikely(!hugepage_kobj)) { | 501 | if (unlikely(!hugepage_kobj)) { |