]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
UBUNTU: SAUCE: Clear Linux: ksm-wakeups
authorArjan van de Ven <arjan@linux.intel.com>
Mon, 14 Mar 2016 17:06:46 +0000 (11:06 -0600)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 20 Feb 2017 03:57:58 +0000 (20:57 -0700)
reduce wakeups in ksm by adding rounding (aligning) when the sleep times are 1 second or longer

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
mm/ksm.c

index 9ae6011a41f895d56942175814d1fe0158a591b7..eecd3ff669e2bbe1e25cc2719c83ad354082b8f3 100644 (file)
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -1725,8 +1725,12 @@ static int ksm_scan_thread(void *nothing)
                try_to_freeze();
 
                if (ksmd_should_run()) {
-                       schedule_timeout_interruptible(
-                               msecs_to_jiffies(ksm_thread_sleep_millisecs));
+                       if (ksm_thread_sleep_millisecs >= 1000)
+                               schedule_timeout_interruptible(
+                                       msecs_to_jiffies(round_jiffies_relative(ksm_thread_sleep_millisecs)));
+                       else
+                               schedule_timeout_interruptible(
+                                       msecs_to_jiffies(ksm_thread_sleep_millisecs));
                } else {
                        wait_event_freezable(ksm_thread_wait,
                                ksmd_should_run() || kthread_should_stop());