callout(9) and Giant lock

Robert N. M. Watson rwatson at freebsd.org
Mon Jul 13 18:49:27 UTC 2009


On 13 Jul 2009, at 19:17, John Baldwin wrote:

>> Callouts are marked as MPSAFE or non-MPSAFE when registered.  If  
>> non-MPSAFE,
>> we will acquire Giant automatically for the callout, but I believe  
>> we'll also
>> try and sort non-MPSAFE callouts behind MPSAFE ones in execution  
>> order to
>> minimize latency for MPSAFE callouts.  Most callouts acquire locks  
>> of some
>> sort, and stalling any callout indefinitely will stall the entire  
>> callout
>> thread indefinitely, which in turn could lead to a variety of odd  
>> behaviors
>> and potentially (although not necessarily) deadlock.
>
> FWIW, we do not actually sort the callouts in this manner, so all  
> callouts
> will be blocked until Giant is acquired.

I must have been remembering a proposed change -- as you say, it's  
certainly not in kern_timeout.c. However, I'd rather just eliminate  
support for Giant in callouts in 9.x than try to further facilitate  
them :-)

Robert


More information about the freebsd-hackers mailing list