-/* $OpenBSD: kern_synch.c,v 1.120 2015/05/07 18:30:27 mikeb Exp $ */
+/* $OpenBSD: kern_synch.c,v 1.121 2015/05/12 09:30:35 mikeb Exp $ */
/* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
/*
{
struct sleep_state sls;
int error, error1;
+#ifdef MULTIPROCESSOR
+ int hold_count;
+#endif
KASSERT((priority & ~(PRIMASK | PCATCH)) == 0);
*/
s = splhigh();
splx(safepri);
+#ifdef MULTIPROCESSOR
+ if (__mp_lock_held(&kernel_lock)) {
+ hold_count = __mp_release_all(&kernel_lock);
+ __mp_acquire_count(&kernel_lock, hold_count);
+ }
+#endif
splx(s);
return (0);
}
{
struct sleep_state sls;
int error, error1, spl;
+#ifdef MULTIPROCESSOR
+ int hold_count;
+#endif
KASSERT((priority & ~(PRIMASK | PCATCH | PNORELOCK)) == 0);
KASSERT(mtx != NULL);
spl = MUTEX_OLDIPL(mtx);
MUTEX_OLDIPL(mtx) = safepri;
mtx_leave(mtx);
+#ifdef MULTIPROCESSOR
+ if (__mp_lock_held(&kernel_lock)) {
+ hold_count = __mp_release_all(&kernel_lock);
+ __mp_acquire_count(&kernel_lock, hold_count);
+ }
+#endif
if ((priority & PNORELOCK) == 0) {
mtx_enter(mtx);
MUTEX_OLDIPL(mtx) = spl;
-/* $OpenBSD: vfs_subr.c,v 1.230 2015/03/14 03:38:51 jsg Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.231 2015/05/12 09:30:35 mikeb Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
struct buf *bp;
int iter, nbusy, dcount, s;
struct proc *p;
+#ifdef MULTIPROCESSOR
+ int hold_count;
+#endif
p = curproc? curproc : &proc0;
sys_sync(p, (void *)0, (register_t *)0);
break;
if (verbose)
printf("%d ", nbusy);
+#ifdef MULTIPROCESSOR
+ if (__mp_lock_held(&kernel_lock))
+ hold_count = __mp_release_all(&kernel_lock);
+ else
+ hold_count = 0;
+#endif
DELAY(40000 * iter);
+#ifdef MULTIPROCESSOR
+ if (hold_count)
+ __mp_acquire_count(&kernel_lock, hold_count);
+#endif
}
return nbusy;