[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140121093859.GA7546@localhost.localdomain>
Date: Tue, 21 Jan 2014 17:38:59 +0800
From: Han Pingtian <hanpt@...ux.vnet.ibm.com>
To: linux-kernel@...r.kernel.org
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Michal Hocko <mhocko@...e.cz>, Mel Gorman <mgorman@...e.de>,
linux-mm@...ck.org, Dave Hansen <dave.hansen@...el.com>,
David Rientjes <rientjes@...gle.com>
Subject: [RFC] restore user defined min_free_kbytes when disabling thp
The testcase 'thp04' of LTP will enable THP, do some testing, then
disable it if it wasn't enabled. But this will leave a different value
of min_free_kbytes if it has been set by admin. So I think it's better
to restore the user defined value after disabling THP.
---
thp increases the value of min_free_kbytes in initialization. This will
change the user defined value of min_free_kbytes. So try to restore the
value when disabling thp.
Signed-off-by: Han Pingtian <hanpt@...ux.vnet.ibm.com>
---
mm/huge_memory.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 94a824f..276180b 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -164,6 +164,15 @@ static int start_khugepaged(void)
} else if (khugepaged_thread) {
kthread_stop(khugepaged_thread);
khugepaged_thread = NULL;
+
+ if (user_min_free_kbytes >= 0) {
+ pr_info("restore min_free_kbytes from %d to user "
+ "defined %d when stopping khugepaged\n",
+ min_free_kbytes, user_min_free_kbytes);
+
+ min_free_kbytes = user_min_free_kbytes;
+ setup_per_zone_wmarks();
+ }
}
return err;
--
1.7.7.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists