Re: [GIT PULL rcu/next] RCU commits for 3.1

From: Eric Dumazet
Date: Mon Nov 07 2011 - 09:41:17 EST


Le lundi 07 novembre 2011 Ã 14:24 +0000, Stephane Eranian a Ãcrit :
> Hi,
>
> Some second thoughts on this.
>
> We get the warning because:
>
> #define task_subsys_state_check(task, subsys_id, __c) \
> rcu_dereference_check(task->cgroups->subsys[subsys_id], \
> lockdep_is_held(&task->alloc_lock) || \
> cgroup_lock_is_held() || (__c))
>
>
> In other words, we need the alloc_lock held.
>
> What I don't quite understand in your patch in the connection
> between rcu and this particular task lock. Unless holding
> the rcu read lock implies you necessarily hold the alloc_lock.
>
> Can you explain?

#define rcu_dereference_check(p, c) \
__rcu_dereference_check((p), rcu_read_lock_held() || (c), __rcu)

So if you hold rcu_read_lock(), (c) is not checked/asserted.



--
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/