Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Nov 2003 11:22:05 -0500 (EST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org
Subject:   RE: cvs commit: src/sys/kern subr_turnstile.c
Message-ID:  <XFMail.20031113112205.jhb@FreeBSD.org>
In-Reply-To: <XFMail.20031112185134.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 12-Nov-2003 John Baldwin wrote:
> 
> On 12-Nov-2003 John Baldwin wrote:
>> jhb         2003/11/12 15:48:42 PST
>> 
>>   FreeBSD src repository
>> 
>>   Modified files:
>>     sys/kern             subr_turnstile.c 
>>   Log:
>>   - Close a race where a thread on another CPU could release a contested lock
>>     and empty its turnstile while the blocking threads still pointed to the
>>     turnstile.  If the thread on the first CPU blocked on a lock owned by
>>     one of the threads blocked on the turnstile just woken up, then the
>>     first CPU could try to manipulate a bogus thread queue in the turnstile
>>     during priority propagation.
>>   - Update locking notes for ts_owner and always clear ts_owner, not just
>>     under INVARIANTS.
>>   
>>   Tested by:      sam (1)
> 
> This might fix the SMP problems on current.  Please let me know if
> there are any other turnstile/mutex/priority_propagation related
> panics.

Also, as a side note, I believe that this race is the cause of the recently
reported panics in propagate_priority() with td_blocked == NULL in the
pre-turnstile mutex code.  The race is only just now being triggered
because we have enough code out from under Giant to trigger it.  This
is why debug.mpsafenet seemed to "fix" that panic.  This is also why I
did not see this race when I tested turnstiles earlier on my SMP
machines.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20031113112205.jhb>