cvs commit: src/sys/alpha/alpha critical.c machdep.c mp_machdep.c
vm_machdep.c src/sys/alpha/include critical.h proc.h
src/sys/amd64/amd64 critical.c machdep.c mp_machdep.c vm_machdep.c...
John Baldwin
jhb at FreeBSD.org
Mon Apr 4 14:53:57 PDT 2005
jhb 2005-04-04 21:53:56 UTC
FreeBSD src repository
Modified files:
sys/alpha/alpha machdep.c mp_machdep.c vm_machdep.c
sys/alpha/include proc.h
sys/amd64/amd64 machdep.c mp_machdep.c vm_machdep.c
sys/amd64/include proc.h
sys/arm/arm machdep.c vm_machdep.c
sys/arm/include proc.h
sys/conf files.alpha files.amd64 files.arm
files.i386 files.ia64 files.pc98
files.powerpc files.sparc64
sys/dev/sio sio_pci.c
sys/i386/i386 machdep.c mp_machdep.c vm_machdep.c
sys/i386/include proc.h
sys/ia64/ia64 machdep.c mp_machdep.c vm_machdep.c
sys/ia64/include proc.h
sys/kern kern_fork.c kern_idle.c kern_mutex.c
kern_proc.c kern_switch.c
sys/pc98/i386 machdep.c
sys/powerpc/include proc.h
sys/powerpc/powerpc machdep.c vm_machdep.c
sys/sparc64/include proc.h
sys/sparc64/sparc64 machdep.c mp_machdep.c vm_machdep.c
sys/sys lock.h mutex.h
Removed files:
sys/alpha/alpha critical.c
sys/alpha/include critical.h
sys/amd64/amd64 critical.c
sys/amd64/include critical.h
sys/arm/arm critical.c
sys/arm/include critical.h
sys/i386/i386 critical.c
sys/i386/include critical.h
sys/ia64/ia64 critical.c
sys/ia64/include critical.h
sys/pc98/include critical.h
sys/powerpc/include critical.h
sys/powerpc/powerpc critical.c
sys/sparc64/include critical.h
sys/sparc64/sparc64 critical.c
Log:
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
Revision Changes Path
1.7 +0 -57 src/sys/alpha/alpha/critical.c (dead)
1.235 +24 -0 src/sys/alpha/alpha/machdep.c
1.56 +19 -2 src/sys/alpha/alpha/mp_machdep.c
1.108 +8 -0 src/sys/alpha/alpha/vm_machdep.c
1.7 +0 -88 src/sys/alpha/include/critical.h (dead)
1.18 +2 -1 src/sys/alpha/include/proc.h
1.15 +0 -48 src/sys/amd64/amd64/critical.c (dead)
1.633 +24 -0 src/sys/amd64/amd64/machdep.c
1.251 +16 -0 src/sys/amd64/amd64/mp_machdep.c
1.245 +8 -0 src/sys/amd64/amd64/vm_machdep.c
1.11 +0 -87 src/sys/amd64/include/critical.h (dead)
1.24 +2 -1 src/sys/amd64/include/proc.h
1.3 +0 -52 src/sys/arm/arm/critical.c (dead)
1.16 +24 -0 src/sys/arm/arm/machdep.c
1.11 +8 -0 src/sys/arm/arm/vm_machdep.c
1.4 +0 -54 src/sys/arm/include/critical.h (dead)
1.5 +2 -1 src/sys/arm/include/proc.h
1.117 +0 -1 src/sys/conf/files.alpha
1.61 +0 -1 src/sys/conf/files.amd64
1.5 +0 -1 src/sys/conf/files.arm
1.524 +0 -1 src/sys/conf/files.i386
1.75 +0 -1 src/sys/conf/files.ia64
1.318 +0 -1 src/sys/conf/files.pc98
1.42 +0 -1 src/sys/conf/files.powerpc
1.66 +0 -1 src/sys/conf/files.sparc64
1.19 +1 -0 src/sys/dev/sio/sio_pci.c
1.14 +0 -48 src/sys/i386/i386/critical.c (dead)
1.611 +24 -0 src/sys/i386/i386/machdep.c
1.245 +19 -1 src/sys/i386/i386/mp_machdep.c
1.254 +8 -0 src/sys/i386/i386/vm_machdep.c
1.11 +0 -87 src/sys/i386/include/critical.h (dead)
1.25 +2 -1 src/sys/i386/include/proc.h
1.6 +0 -55 src/sys/ia64/ia64/critical.c (dead)
1.199 +24 -0 src/sys/ia64/ia64/machdep.c
1.54 +18 -2 src/sys/ia64/ia64/mp_machdep.c
1.88 +8 -0 src/sys/ia64/ia64/vm_machdep.c
1.7 +0 -89 src/sys/ia64/include/critical.h (dead)
1.14 +2 -1 src/sys/ia64/include/proc.h
1.250 +0 -2 src/sys/kern/kern_fork.c
1.43 +0 -4 src/sys/kern/kern_idle.c
1.153 +2 -2 src/sys/kern/kern_mutex.c
1.229 +0 -1 src/sys/kern/kern_proc.c
1.110 +0 -4 src/sys/kern/kern_switch.c
1.357 +24 -0 src/sys/pc98/i386/machdep.c
1.2 +0 -6 src/sys/pc98/include/critical.h (dead)
1.9 +0 -90 src/sys/powerpc/include/critical.h (dead)
1.7 +2 -1 src/sys/powerpc/include/proc.h
1.6 +0 -44 src/sys/powerpc/powerpc/critical.c (dead)
1.88 +24 -0 src/sys/powerpc/powerpc/machdep.c
1.108 +8 -0 src/sys/powerpc/powerpc/vm_machdep.c
1.7 +0 -91 src/sys/sparc64/include/critical.h (dead)
1.14 +2 -1 src/sys/sparc64/include/proc.h
1.9 +0 -55 src/sys/sparc64/sparc64/critical.c (dead)
1.123 +26 -0 src/sys/sparc64/sparc64/machdep.c
1.28 +5 -6 src/sys/sparc64/sparc64/mp_machdep.c
1.72 +8 -0 src/sys/sparc64/sparc64/vm_machdep.c
1.51 +2 -0 src/sys/sys/lock.h
1.77 +6 -6 src/sys/sys/mutex.h
More information about the cvs-src
mailing list