Re: [PATCH 2/2] CRED: Fix __task_cred()'s lockdep check and banner comment

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Oleg Nesterov
Date: Wednesday, August 4, 2010 - 8:08 am

On 08/04, David Howells wrote:

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.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 2/2] CRED: Fix __task_cred()'s lockdep check an ..., Oleg Nesterov, (Wed Aug 4, 8:08 am)
Re: [PATCH 2/2] CRED: Fix __task_cred()'s lockdep check an ..., Eric W. Biederman, (Thu Aug 5, 12:19 am)