summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorAndrea Arcangeli <aarcange@redhat.com>2010-11-02 21:46:58 +0100
committerAndrea Arcangeli <aarcange@redhat.com>2010-11-02 20:47:43 +0000
commit735d2a585dca624aa4cbc6586f4b0da2107b1450 (patch)
tree2cc857bc5bd398e806f2b7b55d0f1b944dbfcb2c /mm
parent8e8b82243f899168ed4b3530cc9309286d81b689 (diff)
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>
Diffstat (limited to 'mm')
-rw-r--r--mm/huge_memory.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 253fa2cdd24f..ee395ff94c82 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -487,7 +487,15 @@ static int __init hugepage_init(void)
int err;
#ifdef CONFIG_SYSFS
static struct kobject *hugepage_kobj;
+#endif
+ err = -EINVAL;
+ if (!has_transparent_hugepage()) {
+ transparent_hugepage_flags = 0;
+ goto out;
+ }
+
+#ifdef CONFIG_SYSFS
err = -ENOMEM;
hugepage_kobj = kobject_create_and_add("transparent_hugepage", mm_kobj);
if (unlikely(!hugepage_kobj)) {