[ltt-dev] [PATCH 0/3] Fixes for threads that are readers and writers, and lock-free queue example

Mathieu Desnoyers compudj at krystal.dyndns.org
Mon Mar 1 16:46:04 EST 2010


* Paolo Bonzini (pbonzini at redhat.com) wrote:
> On 03/01/2010 09:42 PM, Mathieu Desnoyers wrote:
>> * Paolo Bonzini (pbonzini at redhat.com) wrote:
>>> On 03/01/2010 09:14 PM, Mathieu Desnoyers wrote:
>>>> These unpaired lock/unlock are causing this problem.
>>>
>>> Uh-oh.  True.
>>>
>>> However, the fact that a thread cannot be unregistered and then
>>> reregistered remains, no?
>>
>> I fail to see the problem here ? Can you be more specific ?
>
> This sequence fails:
>
>     rcu_register_thread();
>     ... some critical sections and grace periods here ...
>     rcu_unregister_thread();
>
>     ... nothing uses RCU here...
>
>     rcu_register_thread(); // assertion failure on rcu_reader.ctr == 0
>
> Is this also explicitly prohibited?  My patch happens to fix this too.  
> (Of course there's no need to introduce _rcu_thread_{on,off}line, a one  
> liner is enough).

My mistake in rcu_register_thread(), the assert should just check if the
nesting count is zero and not care about the grace period phase bit.
Fixed in commit 4b5be3bea6677b2f10ed15b3e726b77bf6e3d3d0.

Thanks,

Mathieu

>
> Paolo
>

-- 
Mathieu Desnoyers
Operating System Efficiency Consultant
EfficiOS Inc.
http://www.efficios.com




More information about the lttng-dev mailing list