Subject: Re: timedwork
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Iain Hibbert <plunky@rya-online.net>
List: tech-kern
Date: 01/17/2007 22:24:51
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.

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