On Sat, Apr 16, 2005 at 01:12:42AM +0930, Daniel O'Connor wrote:
> On Sat, 16 Apr 2005 00:34, Joerg Sonnenberger wrote:
> > > You may want to check out timeout(9) / untimeout(9), see man 9 timeout
> > > for details.
> >
> > You should not use timeout(9) without a very good reason, the callout_*
> > interface is prefered.
> 
> Can someone add a warning to the top of the makefile similar to the one for 
> spl?

It's not that bad, timeout(9) has a few cases, where replacing it involves
work. I've done that in DragonFly, I know what I'm talking about.

The reason for this advice is that the timeout(9) API has two major short
comings:
(a) It depends on some internal magic to provide the storage, but doesn't
have a clear way to handle errors. The storage space can be a few hundred
KB of kernel memory mostly wasted.
(b) It is difficult to cancel all outstanding timers correctly because
the race conditions are difficult to avoid when calling untimeout.

Since (b) is pretty much a requirement for the kernel nowaday and you
have to keep track of the return value anyway, you can almost mechanically
convert such code to the callout_* interface. That also avoids (a).

Concerning your original question about the inefficiency of DELAY, what
timeouts are we talking about? For anything in the area of a few micro seconds,
DELAY is most likely better, because it avoids context switches and
the associated cache pollution.

Joerg
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to