[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0908051239150.13195@sister.anvils>
Date: Wed, 5 Aug 2009 12:54:49 +0100 (BST)
From: Hugh Dickins <hugh.dickins@...cali.co.uk>
To: Andrew Morton <akpm@...ux-foundation.org>
cc: ieidus@...hat.com, aarcange@...hat.com, riel@...hat.com,
chrisw@...hat.com, nickpiggin@...oo.com.au,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH 5/12] ksm: keep quiet while list empty
On Tue, 4 Aug 2009, Andrew Morton wrote:
> On Mon, 3 Aug 2009 13:14:03 +0100 (BST)
> Hugh Dickins <hugh.dickins@...cali.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
(Phew, for a moment I thought you were asking us to use yield() here.)
>
>
> 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));
>
> ?
I'd be glad to simplify what we have there, but I think your proposal
ends up doing exactly what we're trying to avoid, doesn't it? Won't
it briefly wake up ksmd every ksm_thread_sleep_millisecs, even when
there's nothing for it to do?
>
> That would also reduce the latency in responding to kthread_should_stop().
That's not a high priority consideration. So far as I can tell, the only
use for that test is at startup, if the sysfs_create_group mysteriously
fails. It's mostly a leftover from when you could have CONFIG_KSM=m:
I did wonder whether to go back and add some SLAB_PANICs etc now,
but in the end I was either too lazy or too deferential to Izik's
fine error handling (you choose which to believe: both, actually).
Hugh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists