From 8350ca263ae0f06ae6a40b5e9ba280fb09aff895 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Mon, 14 Mar 2016 11:06:46 -0600 Subject: [PATCH 106/126] ksm-wakeups reduce wakeups in ksm by adding rounding (aligning) when the sleep times are 1 second or longer Signed-off-by: Arjan van de Ven --- mm/ksm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mm/ksm.c b/mm/ksm.c index 6cb60f46cce5..883a9441e055 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -2335,8 +2335,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()); -- 2.15.0 --- linux-4.14/kernel/watchdog.c~ 2017-11-12 18:46:13.000000000 +0000 +++ linux-4.14/kernel/watchdog.c 2017-11-19 17:34:20.740254694 +0000 @@ -44,7 +44,7 @@ int __read_mostly watchdog_user_enabled = 1; int __read_mostly nmi_watchdog_user_enabled = NMI_WATCHDOG_DEFAULT; int __read_mostly soft_watchdog_user_enabled = 1; -int __read_mostly watchdog_thresh = 10; +int __read_mostly watchdog_thresh = 40; int __read_mostly nmi_watchdog_available; struct cpumask watchdog_allowed_mask __read_mostly;