Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/kern/kern_mutex.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/kern/kern_mutex.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.51 retrieving revision 1.51.4.1 diff -u -p -r1.51 -r1.51.4.1 --- src/sys/kern/kern_mutex.c 2011/04/11 19:11:08 1.51 +++ src/sys/kern/kern_mutex.c 2012/04/17 00:08:25 1.51.4.1 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_mutex.c,v 1.51 2011/04/11 19:11:08 rmind Exp $ */ +/* $NetBSD: kern_mutex.c,v 1.51.4.1 2012/04/17 00:08:25 yamt Exp $ */ /*- * Copyright (c) 2002, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -40,7 +40,7 @@ #define __MUTEX_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.51 2011/04/11 19:11:08 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.51.4.1 2012/04/17 00:08:25 yamt Exp $"); #include #include @@ -59,8 +59,6 @@ __KERNEL_RCSID(0, "$NetBSD: kern_mutex.c #include -#include "opt_sa.h" - /* * When not running a debug kernel, spin mutexes are not much * more than an splraiseipl() and splx() pair. @@ -429,9 +427,6 @@ mutex_vector_enter(kmutex_t *mtx) #ifdef MULTIPROCESSOR u_int count; #endif -#ifdef KERN_SA - int f; -#endif LOCKSTAT_COUNTER(spincnt); LOCKSTAT_COUNTER(slpcnt); LOCKSTAT_TIMER(spintime); @@ -539,9 +534,9 @@ mutex_vector_enter(kmutex_t *mtx) LOCKSTAT_START_TIMER(lsflag, spintime); count = SPINLOCK_BACKOFF_MIN; do { - kpreempt_enable(); + KPREEMPT_ENABLE(curlwp); SPINLOCK_BACKOFF(count); - kpreempt_disable(); + KPREEMPT_DISABLE(curlwp); owner = mtx->mtx_owner; } while (mutex_oncpu(owner)); LOCKSTAT_STOP_TIMER(lsflag, spintime); @@ -666,16 +661,6 @@ mutex_vector_enter(kmutex_t *mtx) } #endif /* MULTIPROCESSOR */ -#ifdef KERN_SA - /* - * Sleeping for a mutex should not generate an upcall. - * So set LP_SA_NOBLOCK to indicate this. - * f indicates if we should clear LP_SA_NOBLOCK when done. - */ - f = ~curlwp->l_pflag & LP_SA_NOBLOCK; - curlwp->l_pflag |= LP_SA_NOBLOCK; -#endif /* KERN_SA */ - LOCKSTAT_START_TIMER(lsflag, slptime); turnstile_block(ts, TS_WRITER_Q, mtx, &mutex_syncobj); @@ -683,10 +668,6 @@ mutex_vector_enter(kmutex_t *mtx) LOCKSTAT_STOP_TIMER(lsflag, slptime); LOCKSTAT_COUNT(slpcnt, 1); -#ifdef KERN_SA - curlwp->l_pflag ^= f; -#endif /* KERN_SA */ - owner = mtx->mtx_owner; } KPREEMPT_ENABLE(curlwp);