linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] mm: completely disable THP by transparent_hugepage=never
@ 2011-06-20 16:34 Amerigo Wang
  2011-06-20 16:34 ` [PATCH 2/3] mm: make the threshold of enabling THP configurable Amerigo Wang
                   ` (3 more replies)
  0 siblings, 4 replies; 42+ messages in thread
From: Amerigo Wang @ 2011-06-20 16:34 UTC (permalink / raw)
  To: linux-kernel
  Cc: akpm, Amerigo Wang, Andrea Arcangeli, Rik van Riel,
	Johannes Weiner, KAMEZAWA Hiroyuki, linux-mm

transparent_hugepage=never should mean to disable THP completely,
otherwise we don't have a way to disable THP completely.
The design is broken.

Signed-off-by: WANG Cong <amwang@redhat.com>
---
 mm/huge_memory.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 81532f2..9c63c90 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -488,19 +488,26 @@ static struct attribute_group khugepaged_attr_group = {
 };
 #endif /* CONFIG_SYSFS */
 
+#define hugepage_enabled()	khugepaged_enabled()
+
 static int __init hugepage_init(void)
 {
-	int err;
+	int err = 0;
 #ifdef CONFIG_SYSFS
 	static struct kobject *hugepage_kobj;
 #endif
 
-	err = -EINVAL;
 	if (!has_transparent_hugepage()) {
+		err = -EINVAL;
 		transparent_hugepage_flags = 0;
 		goto out;
 	}
 
+	if (!hugepage_enabled()) {
+		printk(KERN_INFO "hugepage: totally disabled\n");
+		goto out;
+	}
+
 #ifdef CONFIG_SYSFS
 	err = -ENOMEM;
 	hugepage_kobj = kobject_create_and_add("transparent_hugepage", mm_kobj);
-- 
1.7.4.4


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

end of thread, other threads:[~2011-06-22 14:22 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-20 16:34 [PATCH 1/3] mm: completely disable THP by transparent_hugepage=never Amerigo Wang
2011-06-20 16:34 ` [PATCH 2/3] mm: make the threshold of enabling THP configurable Amerigo Wang
2011-06-20 16:59   ` Dave Hansen
2011-06-20 17:23     ` Cong Wang
2011-06-20 16:59   ` Mel Gorman
2011-06-20 17:16     ` Cong Wang
2011-06-21  9:36       ` Mel Gorman
2011-06-22  2:41         ` Cong Wang
2011-06-22  9:16           ` Mel Gorman
2011-06-22 10:46             ` Cong Wang
2011-06-22 11:15               ` Mel Gorman
2011-06-22 12:34                 ` Cong Wang
2011-06-20 16:34 ` [PATCH 3/3] mm: print information when THP is disabled automatically Amerigo Wang
2011-06-20 16:54   ` Andrea Arcangeli
2011-06-20 17:25     ` Cong Wang
2011-06-20 17:01   ` Mel Gorman
2011-06-20 17:26     ` Cong Wang
2011-06-20 19:37       ` Andrea Arcangeli
2011-06-21  9:40       ` Mel Gorman
2011-06-20 16:50 ` [PATCH 1/3] mm: completely disable THP by transparent_hugepage=never Andrea Arcangeli
2011-06-20 16:55   ` Rik van Riel
2011-06-20 17:01   ` Cong Wang
2011-06-20 19:43     ` Andrea Arcangeli
2011-06-21  3:15       ` Cong Wang
2011-06-20 16:58 ` Mel Gorman
2011-06-20 17:07   ` Cong Wang
2011-06-20 17:10     ` Rik van Riel
2011-06-20 17:19       ` Cong Wang
2011-06-20 17:28         ` Rik van Riel
2011-06-20 17:34           ` Cong Wang
2011-06-20 17:50             ` Rik van Riel
2011-06-20 18:25               ` Vivek Goyal
2011-06-20 19:21                 ` Andrea Arcangeli
2011-06-21  4:08                   ` Cong Wang
2011-06-21 14:43                     ` Andrea Arcangeli
2011-06-22  2:56                       ` Cong Wang
2011-06-22 14:22                         ` Andrea Arcangeli
2011-06-21 20:01                     ` Rik van Riel
2011-06-21  3:28               ` Cong Wang
2011-06-20 17:58             ` Eric B Munson
2011-06-21  3:36               ` Cong Wang
2011-06-20 17:59           ` Vivek Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).