diff options
Diffstat (limited to 'patches/boot_time_opt_guest/0104-ksm-wakeups.patch')
-rw-r--r-- | patches/boot_time_opt_guest/0104-ksm-wakeups.patch | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/patches/boot_time_opt_guest/0104-ksm-wakeups.patch b/patches/boot_time_opt_guest/0104-ksm-wakeups.patch new file mode 100644 index 0000000..e0e909a --- /dev/null +++ b/patches/boot_time_opt_guest/0104-ksm-wakeups.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Arjan van de Ven <arjan@linux.intel.com> | ||
3 | Date: Mon, 6 May 2019 12:57:09 -0500 | ||
4 | Subject: [PATCH] ksm-wakeups | ||
5 | |||
6 | reduce wakeups in ksm by adding rounding (aligning) when | ||
7 | the sleep times are 1 second or longer | ||
8 | |||
9 | Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> | ||
10 | --- | ||
11 | kernel/watchdog.c | 2 +- | ||
12 | mm/ksm.c | 11 ++++++++--- | ||
13 | 2 files changed, 9 insertions(+), 4 deletions(-) | ||
14 | |||
15 | diff --git a/kernel/watchdog.c b/kernel/watchdog.c | ||
16 | index 71109065bd8e..44ae1e267d48 100644 | ||
17 | --- a/kernel/watchdog.c | ||
18 | +++ b/kernel/watchdog.c | ||
19 | @@ -41,7 +41,7 @@ unsigned long __read_mostly watchdog_enabled; | ||
20 | int __read_mostly watchdog_user_enabled = 1; | ||
21 | int __read_mostly nmi_watchdog_user_enabled = NMI_WATCHDOG_DEFAULT; | ||
22 | int __read_mostly soft_watchdog_user_enabled = 1; | ||
23 | -int __read_mostly watchdog_thresh = 10; | ||
24 | +int __read_mostly watchdog_thresh = 40; | ||
25 | static int __read_mostly nmi_watchdog_available; | ||
26 | |||
27 | struct cpumask watchdog_cpumask __read_mostly; | ||
28 | diff --git a/mm/ksm.c b/mm/ksm.c | ||
29 | index 9afccc36dbd2..42328775e989 100644 | ||
30 | --- a/mm/ksm.c | ||
31 | +++ b/mm/ksm.c | ||
32 | @@ -2423,9 +2423,14 @@ static int ksm_scan_thread(void *nothing) | ||
33 | |||
34 | if (ksmd_should_run()) { | ||
35 | sleep_ms = READ_ONCE(ksm_thread_sleep_millisecs); | ||
36 | - wait_event_interruptible_timeout(ksm_iter_wait, | ||
37 | - sleep_ms != READ_ONCE(ksm_thread_sleep_millisecs), | ||
38 | - msecs_to_jiffies(sleep_ms)); | ||
39 | + if (sleep_ms >= 1000) | ||
40 | + wait_event_interruptible_timeout(ksm_iter_wait, | ||
41 | + sleep_ms != READ_ONCE(ksm_thread_sleep_millisecs), | ||
42 | + msecs_to_jiffies(round_jiffies_relative(sleep_ms))); | ||
43 | + else | ||
44 | + wait_event_interruptible_timeout(ksm_iter_wait, | ||
45 | + sleep_ms != READ_ONCE(ksm_thread_sleep_millisecs), | ||
46 | + msecs_to_jiffies(sleep_ms)); | ||
47 | } else { | ||
48 | wait_event_freezable(ksm_thread_wait, | ||
49 | ksmd_should_run() || kthread_should_stop()); | ||
50 | -- | ||
51 | https://clearlinux.org | ||
52 | |||