All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/4] mm: completely disable THP by transparent_hugepage=0
@ 2011-06-21  8:10 ` Amerigo Wang
  0 siblings, 0 replies; 56+ messages in thread
From: Amerigo Wang @ 2011-06-21  8:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: akpm, Amerigo Wang, Randy Dunlap, Andrea Arcangeli, Rik van Riel,
	Johannes Weiner, KAMEZAWA Hiroyuki, linux-doc, linux-mm

Introduce "transparent_hugepage=0" to totally disable THP.
"transparent_hugepage=never" means setting THP to be partially
disabled, we need a new way to totally disable it.

Signed-off-by: WANG Cong <amwang@redhat.com>
---
 Documentation/vm/transhuge.txt |    3 ++-
 mm/huge_memory.c               |   12 ++++++++++++
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/Documentation/vm/transhuge.txt b/Documentation/vm/transhuge.txt
index 0924aac..43c4d53 100644
--- a/Documentation/vm/transhuge.txt
+++ b/Documentation/vm/transhuge.txt
@@ -156,7 +156,8 @@ for each pass:
 You can change the sysfs boot time defaults of Transparent Hugepage
 Support by passing the parameter "transparent_hugepage=always" or
 "transparent_hugepage=madvise" or "transparent_hugepage=never"
-(without "") to the kernel command line.
+(without "") to the kernel command line. To totally disable this
+feature, pass "transparent_hugepage=0".
 
 == Need of application restart ==
 
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 81532f2..e4a4f2b 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -488,6 +488,8 @@ static struct attribute_group khugepaged_attr_group = {
 };
 #endif /* CONFIG_SYSFS */
 
+static int no_hugepage_init;
+
 static int __init hugepage_init(void)
 {
 	int err;
@@ -501,6 +503,13 @@ static int __init hugepage_init(void)
 		goto out;
 	}
 
+	if (no_hugepage_init) {
+		err = 0;
+		transparent_hugepage_flags = 0;
+		printk(KERN_INFO "hugepage: totally disabled\n");
+		goto out;
+	}
+
 #ifdef CONFIG_SYSFS
 	err = -ENOMEM;
 	hugepage_kobj = kobject_create_and_add("transparent_hugepage", mm_kobj);
@@ -572,6 +581,9 @@ static int __init setup_transparent_hugepage(char *str)
 		clear_bit(TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG,
 			  &transparent_hugepage_flags);
 		ret = 1;
+	} else if (!strcmp(str, "0")) {
+		no_hugepage_init = 1;
+		ret = 1;
 	}
 out:
 	if (!ret)
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 56+ messages in thread

end of thread, other threads:[~2011-06-23  6:53 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-21  8:10 [PATCH v2 1/4] mm: completely disable THP by transparent_hugepage=0 Amerigo Wang
2011-06-21  8:10 ` Amerigo Wang
2011-06-21  8:10 ` [PATCH v2 2/4] mm: make the threshold of enabling THP configurable Amerigo Wang
2011-06-21  8:10   ` Amerigo Wang
2011-06-21 14:44   ` Dave Hansen
2011-06-21 14:44     ` Dave Hansen
2011-06-21 20:17     ` Dave Hansen
2011-06-21 20:17       ` Dave Hansen
2011-06-22  1:23   ` David Rientjes
2011-06-22  1:23     ` David Rientjes
2011-06-22  3:06     ` Cong Wang
2011-06-22  3:06       ` Cong Wang
2011-06-22  3:29       ` David Rientjes
2011-06-22  3:29         ` David Rientjes
2011-06-22  5:40         ` Cong Wang
2011-06-22  5:40           ` Cong Wang
2011-06-22  6:32           ` David Rientjes
2011-06-22  6:32             ` David Rientjes
2011-06-22 11:07             ` Cong Wang
2011-06-22 11:07               ` Cong Wang
2011-06-22 14:40               ` Andrea Arcangeli
2011-06-22 14:40                 ` Andrea Arcangeli
2011-06-23  6:51                 ` Cong Wang
2011-06-23  6:51                   ` Cong Wang
2011-06-21  8:10 ` [PATCH 3/4] mm: improve THP printk messages Amerigo Wang
2011-06-21  8:10   ` Amerigo Wang
2011-06-22  1:23   ` David Rientjes
2011-06-22  1:23     ` David Rientjes
2011-06-22  3:04     ` Cong Wang
2011-06-22  3:04       ` Cong Wang
2011-06-21  8:10 ` [PATCH 4/4] mm: introduce no_ksm to disable totally KSM Amerigo Wang
2011-06-21  8:10   ` Amerigo Wang
2011-06-21 13:32   ` Andrea Arcangeli
2011-06-21 13:32     ` Andrea Arcangeli
2011-06-22  3:13     ` Cong Wang
2011-06-22  3:13       ` Cong Wang
2011-06-21 11:52 ` [PATCH v2 1/4] mm: completely disable THP by transparent_hugepage=0 Michal Hocko
2011-06-21 11:52   ` Michal Hocko
2011-06-21 11:58   ` Michal Hocko
2011-06-21 11:58     ` Michal Hocko
2011-06-21 13:30 ` Andrea Arcangeli
2011-06-21 13:30   ` Andrea Arcangeli
2011-06-22  3:11   ` Cong Wang
2011-06-22  3:11     ` Cong Wang
2011-06-22  1:16 ` David Rientjes
2011-06-22  1:16   ` David Rientjes
2011-06-22  3:08   ` Cong Wang
2011-06-22  3:08     ` Cong Wang
2011-06-22  3:24     ` David Rientjes
2011-06-22  3:24       ` David Rientjes
2011-06-22  5:45       ` Cong Wang
2011-06-22  5:45         ` Cong Wang
2011-06-22  6:23         ` David Rientjes
2011-06-22  6:23           ` David Rientjes
2011-06-22 11:08           ` Cong Wang
2011-06-22 11:08             ` Cong Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.