]> git.proxmox.com Git - mirror_ubuntu-artful-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)
committerSeth Forshee <seth.forshee@canonical.com>
Tue, 5 Sep 2017 12:33:13 +0000 (07:33 -0500)
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 db20f8436bc3c15bf05f86ccec5e7b1f80d807cc..679ffe3f11e3647259cf94177d8b7e5e59ae33b1 100644 (file)
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -2332,8 +2332,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());