summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_mutex.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2004-01-25 03:54:52 +0000
committerjeff <jeff@FreeBSD.org>2004-01-25 03:54:52 +0000
commitc85cdc3d0fd697f504c2f05524ded0b3282c75bf (patch)
tree5db1ead5d1c75b7e2ece1d370fa6708964bf49f8 /sys/kern/kern_mutex.c
parentca8a19313e2f06d57456af75aaa70204aa2efede (diff)
downloadFreeBSD-src-c85cdc3d0fd697f504c2f05524ded0b3282c75bf.zip
FreeBSD-src-c85cdc3d0fd697f504c2f05524ded0b3282c75bf.tar.gz
- Add a flags parameter to mi_switch. The value of flags may be SW_VOL or
SW_INVOL. Assert that one of these is set in mi_switch() and propery adjust the rusage statistics. This is to simplify the large number of users of this interface which were previously all required to adjust the proper counter prior to calling mi_switch(). This also facilitates more switch and locking optimizations. - Change all callers of mi_switch() to pass the appropriate paramter and remove direct references to the process statistics.
Diffstat (limited to 'sys/kern/kern_mutex.c')
-rw-r--r--sys/kern/kern_mutex.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c
index ca45e67..0ab4fb6 100644
--- a/sys/kern/kern_mutex.c
+++ b/sys/kern/kern_mutex.c
@@ -654,8 +654,7 @@ _mtx_unlock_sleep(struct mtx *m, int opts, const char *file, int line)
"_mtx_unlock_sleep: %p switching out lock=%p", m,
(void *)m->mtx_lock);
- td->td_proc->p_stats->p_ru.ru_nivcsw++;
- mi_switch();
+ mi_switch(SW_INVOL);
if (LOCK_LOG_TEST(&m->mtx_object, opts))
CTR2(KTR_LOCK, "_mtx_unlock_sleep: %p resuming lock=%p",
m, (void *)m->mtx_lock);
OpenPOWER on IntegriCloud