Move all the softclock/callout initialization out of MD and into MI. Get rid
authorMatthew Dillon <dillon@dragonflybsd.org>
Fri, 17 Sep 2004 00:18:16 +0000 (00:18 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Fri, 17 Sep 2004 00:18:16 +0000 (00:18 +0000)
commit92b561b7dcf46484c308ba342eff570648027647
treec2809a37b7b41ae4bbbe394928815556ca976a62
parent2807906ec463b24ae60e5cd6ce797cf48d1dc989
Move all the softclock/callout initialization out of MD and into MI.  Get rid
of the extremely low-level virtual address space allocation for the old
timeout() API's data structures and simply malloc() them in the new MI code
(they will soon be removed entirely when the old API is removed).  Replace
the softclock swi with a non-preempting high priority helper thread (one
per cpu).  The lack of preemption allows us to retain compatibility with
splsoftclock() use elsewhere in the kernel until those uses can be cleaned up,
then we *might* make softclock threads preempt-capable.

Rewrite the callout_*() implementation to make all data structures per-cpu.
Add an MP flag (similar to what FreeBSD did), but create a separate API
function, callout_init_mp() instead of adding an additional badly defined
argument to callout_init().   callout_reset() and callout_stop() will now
complain if the supplied structure is uninitialized (zero'd, e.g.
callout_init() was not called on it).

It is our intention to obsolete the old timeout()/untimeout() APIs and work
is ongoing in that regard, and Joerg will soon import the new OpenBSD
timeout_{set,add,del}() API.  The callout*() API will be retained.

In DragonFly these APIs will guarentee that the callback will occur on the
same cpu that the timeout was added on, a feature that the TCP protocol stacks
will soon be able to take advantage of.

Idea and Brainstorming by: Jeffrey Hsu, Joerg Sonnenberger, and Matthew Dillon
sys/dev/crypto/rndtest/rndtest.c
sys/i386/i386/machdep.c
sys/kern/kern_clock.c
sys/kern/kern_timeout.c
sys/platform/pc32/i386/machdep.c
sys/sys/callout.h