Messages in this thread | | | Date | Tue, 4 Aug 2009 14:59:35 -0700 | From | Andrew Morton <> | Subject | Re: [PATCH 5/12] ksm: keep quiet while list empty |
| |
On Mon, 3 Aug 2009 13:14:03 +0100 (BST) Hugh Dickins <hugh.dickins@tiscali.co.uk> wrote:
> + if (ksmd_should_run()) { > schedule_timeout_interruptible( > msecs_to_jiffies(ksm_thread_sleep_millisecs)); > } else { > wait_event_interruptible(ksm_thread_wait, > - (ksm_run & KSM_RUN_MERGE) || > - kthread_should_stop()); > + ksmd_should_run() || kthread_should_stop()); > }
Yields
if (ksmd_should_run()) { schedule_timeout_interruptible( msecs_to_jiffies(ksm_thread_sleep_millisecs)); } else { wait_event_interruptible(ksm_thread_wait, ksmd_should_run() || kthread_should_stop()); }
can it be something like
wait_event_interruptible_timeout(ksm_thread_wait, ksmd_should_run() || kthread_should_stop(), msecs_to_jiffies(ksm_thread_sleep_millisecs));
?
That would also reduce the latency in responding to kthread_should_stop().
| |