Subject: Re: timedwork
To: None <plunky@rya-online.net>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 01/18/2007 21:38:35
> On Tue, 16 Jan 2007, Iain Hibbert wrote:
> 
> > I think the attached method is cleaner (is untried, not sure if its
> > complete or the locking is ok?)
> 
> In fact I think that locking was wrong, since CALLOUT_LOCK() involves
> splsched() and tsleep/wakeup is then prohibited.

how does it prohibit tsleep/wakeup?

> Is there a reason that callout(9) does not use splclock() as is mentioned
> in spl(9) ?
> 
>      splclock()       blocks the hardware clock interrupt.  It is used by
>                       hardclock() to update kernel and process times, and must
>                       be used by any other code that accesses time-related
>                       data, specifically the time and mono_time global vari-
>                       ables.  This level also protects the callout(9) data
>                       structures, and nothing running at or above this level
>                       may schedule, cancel, or otherwise access any callout-
>                       related data structures.
> 
> It doesn't look like a holdover from OpenBSD since there was no spl
> protection in the original. Maybe Jason can remember?
> 
> iain

i think making it splclock() is fine, but haven't checked all callers. :)

YAMAMOTO Takashi