All of lore.kernel.org
 help / color / mirror / Atom feed
From: Han Pingtian <hanpt@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@suse.cz>, Mel Gorman <mgorman@suse.de>,
	linux-mm@kvack.org, Dave Hansen <dave.hansen@intel.com>,
	David Rientjes <rientjes@google.com>
Subject: [RFC] restore user defined min_free_kbytes when disabling thp
Date: Tue, 21 Jan 2014 17:38:59 +0800	[thread overview]
Message-ID: <20140121093859.GA7546@localhost.localdomain> (raw)

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@linux.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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Han Pingtian <hanpt@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@suse.cz>, Mel Gorman <mgorman@suse.de>,
	linux-mm@kvack.org, Dave Hansen <dave.hansen@intel.com>,
	David Rientjes <rientjes@google.com>
Subject: [RFC] restore user defined min_free_kbytes when disabling thp
Date: Tue, 21 Jan 2014 17:38:59 +0800	[thread overview]
Message-ID: <20140121093859.GA7546@localhost.localdomain> (raw)

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@linux.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


             reply	other threads:[~2014-01-21  9:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-21  9:38 Han Pingtian [this message]
2014-01-21  9:38 ` [RFC] restore user defined min_free_kbytes when disabling thp Han Pingtian
2014-01-21 10:23 ` Mel Gorman
2014-01-21 10:23   ` Mel Gorman
2014-01-22  6:05   ` Han Pingtian
2014-01-22  6:05     ` Han Pingtian
2014-01-22  9:40     ` Mel Gorman
2014-01-22  9:40       ` Mel Gorman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140121093859.GA7546@localhost.localdomain \
    --to=hanpt@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave.hansen@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@suse.cz \
    --cc=rientjes@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.