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

From: Stephane Eranian
Date: Mon Nov 07 2011 - 09:44:22 EST


On Mon, Nov 7, 2011 at 2:41 PM, Eric Dumazet <eric.dumazet@xxxxxxxxx> wrote:
> 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.
>
Ok, got it now. I only looked at the lockdep_is_held() part, thus my confusion.
Thanks.

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