]> git.proxmox.com Git - mirror_ubuntu-bionic-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>
Mon, 29 Jan 2018 13:44:53 +0000 (07:44 -0600)
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 be8f4576f84211499e269f4c69f993a975a8e0a9..b16fb51113b93b0d976b43483caf145f8d372558 100644 (file)
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -2346,8 +2346,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());