diff options
Diffstat (limited to 'patches/boot_time_opt/0107-ksm-wakeups.patch')
| -rw-r--r-- | patches/boot_time_opt/0107-ksm-wakeups.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/patches/boot_time_opt/0107-ksm-wakeups.patch b/patches/boot_time_opt/0107-ksm-wakeups.patch new file mode 100644 index 0000000..2b25625 --- /dev/null +++ b/patches/boot_time_opt/0107-ksm-wakeups.patch | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | From a5de04044d428bf54472365e7dc07958aa184daf Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Arjan van de Ven <arjan@linux.intel.com> | ||
| 3 | Date: Mon, 14 Mar 2016 11:06:46 -0600 | ||
| 4 | Subject: [PATCH 107/124] ksm-wakeups | ||
| 5 | |||
| 6 | reduce wakeups in ksm by adding rounding (aligning) when the sleep times are 1 second or longer | ||
| 7 | |||
| 8 | Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> | ||
| 9 | --- | ||
| 10 | mm/ksm.c | 8 ++++++-- | ||
| 11 | 1 file changed, 6 insertions(+), 2 deletions(-) | ||
| 12 | |||
| 13 | diff --git a/mm/ksm.c b/mm/ksm.c | ||
| 14 | index 9ae6011a41f8..eecd3ff669e2 100644 | ||
| 15 | --- a/mm/ksm.c | ||
| 16 | +++ b/mm/ksm.c | ||
| 17 | @@ -1725,8 +1725,12 @@ static int ksm_scan_thread(void *nothing) | ||
| 18 | try_to_freeze(); | ||
| 19 | |||
| 20 | if (ksmd_should_run()) { | ||
| 21 | - schedule_timeout_interruptible( | ||
| 22 | - msecs_to_jiffies(ksm_thread_sleep_millisecs)); | ||
| 23 | + if (ksm_thread_sleep_millisecs >= 1000) | ||
| 24 | + schedule_timeout_interruptible( | ||
| 25 | + msecs_to_jiffies(round_jiffies_relative(ksm_thread_sleep_millisecs))); | ||
| 26 | + else | ||
| 27 | + schedule_timeout_interruptible( | ||
| 28 | + msecs_to_jiffies(ksm_thread_sleep_millisecs)); | ||
| 29 | } else { | ||
| 30 | wait_event_freezable(ksm_thread_wait, | ||
| 31 | ksmd_should_run() || kthread_should_stop()); | ||
| 32 | -- | ||
| 33 | 2.11.1 | ||
| 34 | |||
