freebsd-skq/sys
John Baldwin c6a37e8413 Divorce critical sections from spinlocks. Critical sections as denoted by
critical_enter() and critical_exit() are now solely a mechanism for
deferring kernel preemptions.  They no longer have any affect on
interrupts.  This means that standalone critical sections are now very
cheap as they are simply unlocked integer increments and decrements for the
common case.

Spin mutexes now use a separate KPI implemented in MD code: spinlock_enter()
and spinlock_exit().  This KPI is responsible for providing whatever MD
guarantees are needed to ensure that a thread holding a spin lock won't
be preempted by any other code that will try to lock the same lock.  For
now all archs continue to block interrupts in a "spinlock section" as they
did formerly in all critical sections.  Note that I've also taken this
opportunity to push a few things into MD code rather than MI.  For example,
critical_fork_exit() no longer exists.  Instead, MD code ensures that new
threads have the correct state when they are created.  Also, we no longer
try to fixup the idlethreads for APs in MI code.  Instead, each arch sets
the initial curthread and adjusts the state of the idle thread it borrows
in order to perform the initial context switch.

This change is largely a big NOP, but the cleaner separation it provides
will allow for more efficient alternative locking schemes in other parts
of the kernel (bare critical sections rather than per-CPU spin mutexes
for per-CPU data for example).

Reviewed by:	grehan, cognet, arch@, others
Tested on:	i386, alpha, sparc64, powerpc, arm, possibly more
2005-04-04 21:53:56 +00:00
..
alpha Divorce critical sections from spinlocks. Critical sections as denoted by 2005-04-04 21:53:56 +00:00
amd64 Divorce critical sections from spinlocks. Critical sections as denoted by 2005-04-04 21:53:56 +00:00
arm Divorce critical sections from spinlocks. Critical sections as denoted by 2005-04-04 21:53:56 +00:00
boot Fix buidling of boot blocks for pc98 with new links. 2005-04-03 04:58:15 +00:00
bsm Add a stub audit_kevents.h, which defines exactly one audit event: 2005-02-02 14:27:36 +00:00
cam avoid use after free 2005-03-31 21:43:19 +00:00
coda Explicitly hold a reference to the cdev we have just cloned. This 2005-03-31 12:19:44 +00:00
compat - Change the vm_mmap() function to accept an objtype_t parameter specifying 2005-04-01 20:00:11 +00:00
conf Divorce critical sections from spinlocks. Critical sections as denoted by 2005-04-04 21:53:56 +00:00
contrib This commit was generated by cvs2svn to compensate for changes in r143439, 2005-03-12 00:17:37 +00:00
crypto gbde(8) is also rejndael user. 2005-03-11 22:07:04 +00:00
ddb
dev Divorce critical sections from spinlocks. Critical sections as denoted by 2005-04-04 21:53:56 +00:00
doc
fs - Fix union's assumptions about when the dvp is unlocked. It is only 2005-04-04 09:36:26 +00:00
gdb check return value of gdb_rx_varhex 2005-03-28 18:31:18 +00:00
geom - Add a missing g_io_deliver() in case of allocation failure - we didn't 2005-04-03 14:55:49 +00:00
gnu - Remove wantparent, it is no longer necessary. An assert in vfs_lookup.c 2005-03-29 13:09:42 +00:00
i4b Add device ID for Planet IA 128P-STD card. 2005-03-19 03:00:22 +00:00
i386 Divorce critical sections from spinlocks. Critical sections as denoted by 2005-04-04 21:53:56 +00:00
ia64 Divorce critical sections from spinlocks. Critical sections as denoted by 2005-04-04 21:53:56 +00:00
isa - Don't enable periodic interrupts from the RTC by default in rtc_statusb. 2005-03-24 21:34:16 +00:00
isofs/cd9660 - We no longer have to bother with PDIRUNLOCK, lookup() handles it for us. 2005-03-28 09:34:36 +00:00
kern Divorce critical sections from spinlocks. Critical sections as denoted by 2005-04-04 21:53:56 +00:00
libkern Replace the current strspn() and strcspn() with significantly faster 2005-04-02 18:52:44 +00:00
modules Add support for _PDC/_OSC by advertising that we support direct access to 2005-04-04 15:51:13 +00:00
net Explicitly hold a reference to the cdev we have just cloned. This 2005-03-31 12:19:44 +00:00
net80211 remove extern from function decls 2005-04-04 04:27:20 +00:00
netatalk When generating a phase II ARP lookup from aarpwhohas(), use a 2005-02-22 14:37:22 +00:00
netatm In the current world order, solisten() implements the state transition of 2005-02-21 21:58:17 +00:00
netgraph Don't init ifp->if_addrhead, if_attach() does it for us. 2005-04-03 05:21:29 +00:00
netinet When several carp interfaces are attached to Ethernet interface, 2005-03-30 11:44:43 +00:00
netinet6 check for malloc failure (also move malloc up to simplify error recovery) 2005-03-29 01:26:27 +00:00
netipsec correct space check 2005-03-09 15:28:48 +00:00
netipx Marginally reformat my copyright statement to remove the spurious ','. 2005-03-10 14:19:31 +00:00
netkey
netnatm Mark netatm and netnatm explicitly as requiring Giant, as they still do. 2005-02-17 14:21:22 +00:00
netncp avoid potential null ptr derefs 2005-02-23 22:44:38 +00:00
netsmb Explicitly hold a reference to the cdev we have just cloned. This 2005-03-31 12:19:44 +00:00
nfs
nfs4client - Remove wantparent, it is no longer necessary. An assert in vfs_lookup.c 2005-03-29 13:09:42 +00:00
nfsclient - LK_NOPAUSE is a nop now. 2005-03-31 04:37:09 +00:00
nfsserver avoid potential null ptr deref by free'ing excess mbufs instead of 2005-03-28 18:51:58 +00:00
opencrypto just use crypto/rijndael, and nuke opencrypto/rindael.[ch]. 2005-03-11 17:24:46 +00:00
pc98 Divorce critical sections from spinlocks. Critical sections as denoted by 2005-04-04 21:53:56 +00:00
pccard Remove more deadwood that never got implemented in NEWCARD, since NEWCARD 2005-02-15 02:54:53 +00:00
pci nVidia AGP chipsets beyond nForce2 are AMD64-specific. 2005-04-02 01:10:09 +00:00
posix4 Actually commit the code for kern_sched_get_rr_interval(). 2005-03-31 22:54:48 +00:00
powerpc Divorce critical sections from spinlocks. Critical sections as denoted by 2005-04-04 21:53:56 +00:00
rpc - Don't call rpcclnt_realign() if we don't have any mbufs to realign. 2005-03-19 01:16:25 +00:00
security Remove an accidental clearing of the new label pointer on a system V 2005-02-24 16:08:41 +00:00
sparc64 Divorce critical sections from spinlocks. Critical sections as denoted by 2005-04-04 21:53:56 +00:00
sys Divorce critical sections from spinlocks. Critical sections as denoted by 2005-04-04 21:53:56 +00:00
tools Add VOP_FOO_APV() which takes a pointer to the vop_vector. 2005-02-08 12:54:32 +00:00
ufs - Use M_ZERO rather than explicitly calling bzero(). 2005-04-03 12:03:44 +00:00
vm Flip the switch and turn mpsafevm on by default for sparc64. 2005-04-04 20:59:02 +00:00
Makefile When building cscopnamefile, default architecture to ${MACHINE}, not i386. 2005-03-08 00:09:41 +00:00