On 02/14, Mandeep Singh Baines wrote: > > Replace the for loop with a simple if.
Why? > --- a/kernel/exit.c > +++ b/kernel/exit.c > @@ -479,12 +479,9 @@ static void exit_mm(struct task_struct * tsk) > if (atomic_dec_and_test(&core_state->nr_threads)) > complete(&core_state->startup); > > - for (;;) { > - set_task_state(tsk, TASK_UNINTERRUPTIBLE); > - if (!self.task) /* see coredump_finish() */ > - break; > + set_task_state(tsk, TASK_UNINTERRUPTIBLE); > + if (self.task) /* see coredump_finish() */ > schedule(); > - } If you think we should not worry about spurious wakeups you can simplify this code even more, you do not need mb() to set TASK_UNINTERRUPTIBLE (just move it before dec_and_test), you do not need "if (self.task)", you do not need __set_task_state(tsk, TASK_RUNNING). But I think we should always worry, so why? Oleg. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/