Re: /proc dcache deadlock in do_exit
From: Oleg Nesterov
Date: Wed Nov 28 2007 - 11:31:46 EST
On 11/27, Eric W. Biederman wrote:
>
> Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> writes:
>
> > On Tue, 27 Nov 2007 14:20:22 +0100
> > Andrea Arcangeli <andrea@xxxxxxx> wrote:
> >
> >> do_exit->release_task->mark_inode_dirty_sync->schedule() (will never
> >> come back to run journal_stop)
> >
> > I don't see why the schedule() will not return? Because the task has
> > PF_EXITING set? Doesn't TASK_DEAD do that?
>
> Yes, why do we not come back from schedule?
>
> If we are not allowed to schedule after setting PF_EXITING before
> we set TASK_DEAD that entire code path sounds brittle and
> error prone.
Yes, it is fine to schedule after release_task(). As Eric pointed out, we
don't race with call_rcu(delayed_put_task_struct), scheduler has another
reference
dup_task_struct:
/* One for us, one for whoever does the "release_task()" (usually parent) */
atomic_set(&tsk->usage,2);
However, with CONFIG_HOTPLUG_CPU we do have the problem here, but this is
off-topic. Preemption is fine, but deactivate_task() is not. We can't migrate
the deactivated released task from the dead CPU.
migrate_live_tasks() can't find the task after __unhash_process()
migrate_dead_tasks() doesn't see it after deactivate_task().
And afaics try_to_wake_up() doesn't necessary change task_cpu() if it is
offline.
No? But again, this is offtopic even if I am right.
Oleg.
-
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/