Sure, this solves the problem. But probably this needs a comment to
explain why do we take rcu lock.
OTOH, wait_task_continued() does need rcu_read_lock(), the task is running.
UNLESS we believe that local_irq_disable() makes rcu_read_lock() unnecessary,
see below.
May be... but we have so many special cases. Say, fill_psinfo()->__task_cred().
This is called under rcu lock, but it is not needed. The task is either
current or it sleeps in exit_mm().
I mean, perhaps it is better to either always require rcu_read_lock()
around __task_cred() even if it is not needed, or do not use
rcu_dereference_check() at all.
In any case, task_is_dead() doesn't help afaics, it is only useful for
wait_task_zombie().
Agreed, the patch looks fine to me.
Yes, please note "It does in practice" above.
My question is, should/can we rely on this fact? Or should we assume
that nothing except rcu_read_lock() implies rcu_read_lock() ?
Oleg.
--