[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4836E057.7020307@yandex.ru>
Date: Fri, 23 May 2008 18:18:47 +0300
From: Artem Bityutskiy <dedekind@...dex.ru>
To: Christoph Hellwig <hch@...radead.org>
CC: Artem Bityutskiy <Artem.Bityutskiy@...ia.com>,
LKML <linux-kernel@...r.kernel.org>,
Adrian Hunter <ext-adrian.hunter@...ia.com>
Subject: Re: [PATCH take 2] UBIFS - new flash file system
Christoph Hellwig wrote:
> - the mainoop of ubifs_bg_thread looks a bit odd either, when you
> first to an interruotible sleep and then possible one while you
> still have TASK_RUNNING set. Also the need_bgt flag is not needed
> because the thrad is only woken up to perform it's action.
> In the end the main loop should look something like:
>
> while (1) {
> if (kthread_should_stop())
> break;
> if (try_to_freeze())
> continue;
>
> run_bg_commit(c);
>
> set_current_state(TASK_INTERRUPTIBLE);
> schedule();
> __set_current_state(TASK_RUNNING);
> }
Err, how are we guaranteed that we do not miss wake-up events then,
if we were woken up say, between run_bg_commit(c) and
set_current_state(TASK_INTERRUPTIBLE) ? This was the purpose
of the 'need_bgt' flag.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
--
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