diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2014-07-31 09:38:07 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2014-08-06 16:44:52 +1000 |
commit | acdc59412b37ba0330ab1a3839601a8a6807208b (patch) | |
tree | 4f40693da2ea511c68581132ee87776bd9aade42 | |
parent | ba784f6a12920b4e96c28fc1cac607e95e49cb59 (diff) |
ksm-provide-support-to-use-deferrable-timers-for-scanner-thread-fix
clean up docs, fix deferrable_timer_store() error handling
Cc: Chintan Pandya <cpandya@codeaurora.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r-- | Documentation/vm/ksm.txt | 12 | ||||
-rw-r--r-- | mm/ksm.c | 9 |
2 files changed, 11 insertions, 10 deletions
diff --git a/Documentation/vm/ksm.txt b/Documentation/vm/ksm.txt index 0481235589cc..9735c87ca363 100644 --- a/Documentation/vm/ksm.txt +++ b/Documentation/vm/ksm.txt @@ -88,12 +88,12 @@ pages_unshared - how many pages unique but repeatedly checked for merging pages_volatile - how many pages changing too fast to be placed in a tree full_scans - how many times all mergeable areas have been scanned deferrable_timer - whether to use deferrable timers or not - e.g. "echo 1 > /sys/kernel/mm/ksm/deferrable_timer" - Default: 0 (means, we are not using deferrable timers. Users - might want to set deferrable_timer option if they donot want - ksm thread to wakeup CPU to carryout ksm activities thus - gaining on battery while compromising slightly on memory - that could have been saved.) + e.g. "echo 1 > /sys/kernel/mm/ksm/deferrable_timer" + Default: 0 (means, we are not using deferrable timers. Users + might want to set deferrable_timer option if they donot want + ksm thread to wakeup CPU to carryout ksm activities thus + gaining on battery while compromising slightly on memory + that could have been saved.) A high ratio of pages_sharing to pages_shared indicates good sharing, but a high ratio of pages_unshared to pages_sharing indicates wasted effort. @@ -2202,10 +2202,11 @@ static ssize_t deferrable_timer_store(struct kobject *kobj, int err; err = kstrtoul(buf, 10, &enable); - - if (enable == 0 || enable == 1) - use_deferrable_timer = enable; - + if (err < 0) + return err; + if (enable >= 1) + return -EINVAL; + use_deferrable_timer = enable; return count; } KSM_ATTR(deferrable_timer); |