freebsd-dev/sys/dev
Luigi Rizzo e4fc250c15 Device Polling code for -current.
Non-SMP, i386-only, no polling in the idle loop at the moment.

To use this code you must compile a kernel with

        options DEVICE_POLLING

and at runtime enable polling with

        sysctl kern.polling.enable=1

The percentage of CPU reserved to userland can be set with

        sysctl kern.polling.user_frac=NN (default is 50)

while the remainder is used by polling device drivers and netisr's.
These are the only two variables that you should need to touch. There
are a few more parameters in kern.polling but the default values
are adequate for all purposes. See the code in kern_poll.c for
more details on them.

Polling in the idle loop will be implemented shortly by introducing
a kernel thread which does the job. Until then, the amount of CPU
dedicated to polling will never exceed (100-user_frac).
The equivalent (actually, better) code for -stable is at

	http://info.iet.unipi.it/~luigi/polling/

and also supports polling in the idle loop.

NOTE to Alpha developers:
There is really nothing in this code that is i386-specific.
If you move the 2 lines supporting the new option from
sys/conf/{files,options}.i386 to sys/conf/{files,options} I am
pretty sure that this should work on the Alpha as well, just that
I do not have a suitable test box to try it. If someone feels like
trying it, I would appreciate it.

NOTE to other developers:
sure some things could be done better, and as always I am open to
constructive criticism, which a few of you have already given and
I greatly appreciated.
However, before proposing radical architectural changes, please
take some time to possibly try out this code, or at the very least
read the comments in kern_poll.c, especially re. the reason why I
am using a soft netisr and cannot (I believe) replace it with a
simple timeout.

Quick description of files touched by this commit:

sys/conf/files.i386
        new file kern/kern_poll.c
sys/conf/options.i386
        new option
sys/i386/i386/trap.c
        poll in trap (disabled by default)
sys/kern/kern_clock.c
        initialization and hardclock hooks.
sys/kern/kern_intr.c
        minor swi_net changes
sys/kern/kern_poll.c
        the bulk of the code.
sys/net/if.h
        new flag
sys/net/if_var.h
        declaration for functions used in device drivers.
sys/net/netisr.h
        NETISR_POLL
sys/dev/fxp/if_fxp.c
sys/dev/fxp/if_fxpvar.h
sys/pci/if_dc.c
sys/pci/if_dcreg.h
sys/pci/if_sis.c
sys/pci/if_sisreg.h
        device driver modifications
2001-12-14 17:56:12 +00:00
..
aac I missed a string concatenation. 2001-12-10 09:34:47 +00:00
acpica Disable sleep requests for 5 sec after wakeup. This is needed for 2001-12-09 18:02:36 +00:00
advansys
agp Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
aha
ahb
aic Migrate to PCMCIA_CARD() macros 2001-11-15 07:52:49 +00:00
aic7xxx
amd
amr Comment tokens after #undef <macroname> and #endif. 2001-12-13 11:12:30 +00:00
an Minor style problem I introduced recently 2001-11-15 06:44:43 +00:00
ar
asr Convert C++ style comments to proper C ones. 2001-12-13 23:48:34 +00:00
ata Allow setting the CD type on cue sheets 2001-12-04 21:39:34 +00:00
atkbdc Hack for the "out-of-sync" error. 2001-10-13 10:28:02 +00:00
awi Add NEWCARD support to awi. 2001-11-19 06:42:11 +00:00
bge Don't pass an interface pointer to VLAN_INPUT{,_TAG}. Get it from the 2001-12-03 17:28:27 +00:00
bktr o Add #include <sys/systm.h> to fix a warning about printf() being 2001-11-26 04:06:47 +00:00
buslogic Use ANSI C string contatenation instead of a multi-line string literal. 2001-12-13 11:14:28 +00:00
cardbus
ccd Return EOPNOTSUPP for unknown module events. 2001-11-17 00:46:08 +00:00
ciss Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
cnw
cs Migrate to PCMCIA_CARD() macros 2001-11-15 07:52:49 +00:00
ct Added Logitec LHA-301 pnp id. 2001-10-09 15:30:19 +00:00
cy Call to cdevsw_add() no longer needed. 2001-11-04 08:49:51 +00:00
dc Device Polling code for -current. 2001-12-14 17:56:12 +00:00
de No FreeBSD/vax here either. 2001-11-03 08:32:28 +00:00
dec Introduce a boot environment variable (clock_compat_osf1) which can 2001-11-03 17:22:50 +00:00
dgb Don't call cdevsw_add(). 2001-11-04 09:09:41 +00:00
digi - Fix a bunch of malloc calls where the M_FLAG is incorrectly used; it 2001-12-07 17:59:15 +00:00
dpt This file is a 2.2 vintage pre-CAM file of no current value. 2001-11-06 07:24:54 +00:00
ed Patch to allow the ed driver interrupt routine to terminate if the 2001-11-24 16:15:18 +00:00
eisa
em Fixed two problems: 2001-12-06 17:50:21 +00:00
en
ep More devices. Obtained from NetBSD. 2001-11-15 07:57:38 +00:00
ex
fb Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
fdc KSE Milestone 2 2001-09-12 08:38:13 +00:00
fe Migrate to PCMCIA_CARD() macros 2001-11-15 07:52:49 +00:00
fxp Device Polling code for -current. 2001-12-14 17:56:12 +00:00
gfb We need to operate on struct thread now, not struct proc. 2001-11-08 01:49:06 +00:00
gx Don't pass an interface pointer to VLAN_INPUT{,_TAG}. Get it from the 2001-12-03 17:28:27 +00:00
hea
hfa
ic
ichsmb Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ida Fix a signed bug in the crashdump code for systems with > 2GB of ram. 2001-11-13 01:08:54 +00:00
ie
iicbus Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
isp Explicitly decode GetAllNext SNS Response back *as* 2001-12-11 21:58:04 +00:00
ispfw Roll firmware to latest offerings... Fixes a number of f/w related 2001-12-13 00:09:06 +00:00
joy Split joystick driver into ISA and PC Card front ends. 2001-12-05 09:08:23 +00:00
kbd Refine ACPI/PnP BIOS probe/attach routines a bit. 2001-09-15 04:38:20 +00:00
lge Do not call mii_polltick() immediately after mii_tick(). 2001-09-29 19:31:29 +00:00
lmc
lnc
mc146818
mca
mcd Don't call cdevsw_add(). 2001-11-04 08:58:22 +00:00
md Implement IO_NOWDRAIN and B_NOWDRAIN - prevents the buffer cache from blocking 2001-11-05 18:48:54 +00:00
mii Fix declaration disagreement. 2001-10-11 22:02:14 +00:00
mlx Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
mly Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
mse KSE Milestone 2 2001-09-12 08:38:13 +00:00
musycc
ncv Remove PAO3 dependent part. 2001-11-03 08:55:34 +00:00
nge Don't pass an interface pointer to VLAN_INPUT{,_TAG}. Get it from the 2001-12-03 17:28:27 +00:00
nmdm Don't call cdevsw_add(). 2001-11-04 15:55:17 +00:00
nsp Remove PAO3 dependent part. 2001-11-03 08:55:34 +00:00
null
ofw 1. Add ofw_pci.h with definitions for the OpenFirmware PCI bindings 2001-11-18 20:38:44 +00:00
pccard Sync to pccarddevs 1.25 2001-12-12 20:06:29 +00:00
pccbb Make the start memory address that we use configurable via a boot 2001-11-26 07:17:09 +00:00
pcf Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
pci Experimental patch to try to properly clip the range of the memory 2001-11-26 07:12:35 +00:00
pcic
pdq
ppbus Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ppc Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
random o Modify open() and close() for /dev/random to use securelevel_gt() instead 2001-09-26 20:15:42 +00:00
ray Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
rc KSE Milestone 2 2001-09-12 08:38:13 +00:00
rp Force the RxBuf and TxBuf arrays to be aligned on 16-bit boundaries to 2001-11-05 12:57:46 +00:00
sbni Add driver for Granch SBNI12-xx ISA and PCI network adapters. 2001-11-21 22:29:35 +00:00
scd Don't call cdevsw_add() 2001-11-04 08:54:15 +00:00
sf Remove printf's on mbuf/cluster allocation failures. There are now 2001-12-14 05:56:35 +00:00
si KSE Milestone 2 2001-09-12 08:38:13 +00:00
sio Split the sio driver for pc98 into bus front end and back end. 2001-11-26 12:29:53 +00:00
sk Remove printf's on mbuf/cluster allocation failures. There are now 2001-12-14 05:56:35 +00:00
smbus SMBus support for the AMD 756 power management unit. See smbus(4), 2001-09-16 22:35:07 +00:00
sn Migrate to PCMCIA_CARD() macros 2001-11-15 07:52:49 +00:00
snc
snp Check the return value of tsleep() in snpread(). This may be 2001-11-24 15:59:46 +00:00
sound Get rid of irritating (bogus) message: 2001-12-10 20:27:18 +00:00
speaker KSE Milestone 2 2001-09-12 08:38:13 +00:00
sr
stg Remove PAO3 dependent part. 2001-11-03 08:55:34 +00:00
streams cast dev_t to int in printf to fix warning. 2001-10-29 01:22:15 +00:00
sym Comment tokens after #undef <macroname> and #endif. 2001-12-13 11:12:30 +00:00
syscons Fix POLA - when selecting line into syscons' cut'n'paste buffer (double 2001-11-25 22:51:30 +00:00
tdfx KSE Milestone 2 2001-09-12 08:38:13 +00:00
tga Add the TGA video driver. This is a great accomplishtment and will help 2001-11-01 08:26:30 +00:00
ti Remove printf's on mbuf/cluster allocation failures. There are now 2001-12-14 05:56:35 +00:00
twe Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
tx
txp Don't pass an interface pointer to VLAN_INPUT{,_TAG}. Get it from the 2001-12-03 17:28:27 +00:00
usb Add DIVA USB mp3 player. 2001-12-12 15:58:23 +00:00
vinum Don't call cdevsw_{add,remove}(). 2001-11-04 11:55:19 +00:00
vr Remove printf's on mbuf/cluster allocation failures. There are now 2001-12-14 05:56:35 +00:00
vx
wds
wi Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
wl KSE Milestone 2 2001-09-12 08:38:13 +00:00
xe