cvs commit: src/sys/kern kern_switch.c sched_4bsd.c sched_core.c
sched_ule.c src/sys/sys mutex.h proc.h sched.h
Jeff Roberson
jeff at FreeBSD.org
Mon Jun 4 23:50:32 UTC 2007
jeff 2007-06-04 23:50:31 UTC
FreeBSD src repository
Modified files:
sys/kern sched_4bsd.c sched_core.c sched_ule.c
kern_switch.c
sys/sys mutex.h proc.h sched.h
Log:
Commit 1/14 of sched_lock decomposition.
- Move all scheduler locking into the schedulers utilizing a technique
similar to solaris's container locking.
- A per-process spinlock is now used to protect the queue of threads,
thread count, suspension count, p_sflags, and other process
related scheduling fields.
- The new thread lock is actually a pointer to a spinlock for the
container that the thread is currently owned by. The container may
be a turnstile, sleepqueue, or run queue.
- thread_lock() is now used to protect access to thread related scheduling
fields. thread_unlock() unlocks the lock and thread_set_lock()
implements the transition from one lock to another.
- A new "blocked_lock" is used in cases where it is not safe to hold the
actual thread's lock yet we must prevent access to the thread.
- sched_throw() and sched_fork_exit() are introduced to allow the
schedulers to fix-up locking at these points.
- Add some minor infrastructure for optionally exporting scheduler
statistics that were invaluable in solving performance problems with
this patch. Generally these statistics allow you to differentiate
between different causes of context switches.
Tested by: kris, current@
Tested on: i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc.
Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each)
Revision Changes Path
1.130 +71 -21 src/sys/kern/kern_switch.c
1.98 +115 -45 src/sys/kern/sched_4bsd.c
1.14 +57 -2 src/sys/kern/sched_core.c
1.193 +136 -39 src/sys/kern/sched_ule.c
1.96 +9 -0 src/sys/sys/mutex.h
1.479 +57 -56 src/sys/sys/proc.h
1.32 +15 -1 src/sys/sys/sched.h
More information about the cvs-all
mailing list