lkml.org 
[lkml]   [2008]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2008-05-23 17:23    [W:0.060 / U:0.800 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site