From c85cdc3d0fd697f504c2f05524ded0b3282c75bf Mon Sep 17 00:00:00 2001 From: jeff Date: Sun, 25 Jan 2004 03:54:52 +0000 Subject: - 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. --- sys/kern/kern_mutex.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sys/kern/kern_mutex.c') 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); -- cgit v1.1