33 lines
962 B
Diff
33 lines
962 B
Diff
|
From d8056696038fd33187ca41e25832ed3960c3ec7f Mon Sep 17 00:00:00 2001
|
||
|
From: Arjan van de Ven <arjan@linux.intel.com>
|
||
|
Date: Mon, 14 Mar 2016 11:06:46 -0600
|
||
|
Subject: [PATCH 12/22] ksm-wakeups
|
||
|
|
||
|
reduce wakeups in ksm
|
||
|
---
|
||
|
mm/ksm.c | 8 ++++++--
|
||
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
||
|
|
||
|
diff --git a/mm/ksm.c b/mm/ksm.c
|
||
|
index caa54a55..b043f871 100644
|
||
|
--- a/mm/ksm.c
|
||
|
+++ b/mm/ksm.c
|
||
|
@@ -1724,8 +1724,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.11.0
|
||
|
|