Re: [PATCH 3/5] coredump: cleanup the waiting for coredump_finishcode

From: Andrew Morton
Date: Fri Feb 15 2013 - 18:31:10 EST


On Thu, 14 Feb 2013 15:38:14 -0800
Mandeep Singh Baines <msb@xxxxxxxxxxxx> wrote:

> Replace the for loop with a simple if.

Well OK, but why? Presumably the loop was added for a reason and
presumably you believe that reason to be (no longer?) correct. Please
describe all these things.

> --- 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();
> - }


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/