diff options
author | Jeff Roberson <jeff@FreeBSD.org> | 2008-03-19 06:19:01 +0000 |
---|---|---|
committer | Jeff Roberson <jeff@FreeBSD.org> | 2008-03-19 06:19:01 +0000 |
commit | 374ae2a39338777f5f9ef0ed726fff2a5dee6485 (patch) | |
tree | 720fece23c8482c35e341e275a0f4068ee43126f /sys/kern/sched_4bsd.c | |
parent | b23372cd8ee7abcc1b32caf4cf72d5bd12f7102f (diff) | |
download | src-374ae2a39338777f5f9ef0ed726fff2a5dee6485.tar.gz src-374ae2a39338777f5f9ef0ed726fff2a5dee6485.zip |
- Relax requirements for p_numthreads, p_threads, p_swtick, and p_nice from
requiring the per-process spinlock to only requiring the process lock.
- Reflect these changes in the proc.h documentation and consumers throughout
the kernel. This is a substantial reduction in locking cost for these
fields and was made possible by recent changes to threading support.
Notes
Notes:
svn path=/head/; revision=177368
Diffstat (limited to 'sys/kern/sched_4bsd.c')
-rw-r--r-- | sys/kern/sched_4bsd.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index ed906b6c896f..691e3b45942d 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -357,7 +357,7 @@ schedcpu(void) realstathz = stathz ? stathz : hz; sx_slock(&allproc_lock); FOREACH_PROC_IN_SYSTEM(p) { - PROC_SLOCK(p); + PROC_LOCK(p); FOREACH_THREAD_IN_PROC(p, td) { awake = 0; thread_lock(td); @@ -436,7 +436,7 @@ XXX this is broken resetpriority_thread(td); thread_unlock(td); } /* end of thread loop */ - PROC_SUNLOCK(p); + PROC_UNLOCK(p); } /* end of process loop */ sx_sunlock(&allproc_lock); } @@ -616,7 +616,7 @@ sched_exit(struct proc *p, struct thread *td) CTR3(KTR_SCHED, "sched_exit: %p(%s) prio %d", td, td->td_name, td->td_priority); - PROC_SLOCK_ASSERT(p, MA_OWNED); + PROC_LOCK_ASSERT(p, MA_OWNED); sched_exit_thread(FIRST_THREAD_IN_PROC(p), td); } @@ -656,7 +656,6 @@ sched_nice(struct proc *p, int nice) struct thread *td; PROC_LOCK_ASSERT(p, MA_OWNED); - PROC_SLOCK_ASSERT(p, MA_OWNED); p->p_nice = nice; FOREACH_THREAD_IN_PROC(p, td) { thread_lock(td); |