From 0bf3b91d8accdf330ac840c013816b9f30fbc2ed Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Wed, 13 Dec 2000 01:06:53 +0000 Subject: [PATCH] Use proper mutex locking when calling setrunnable from speedup_syncer(). Submitted by: Tor.Egge@fast.no --- sys/kern/vfs_export.c | 5 ++--- sys/kern/vfs_subr.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index a6bae88f2ada..f72095a11b81 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -1103,12 +1103,11 @@ sched_sync(void) int speedup_syncer() { - int s; - s = splhigh(); + mtx_enter(&sched_lock, MTX_SPIN); if (updateproc->p_wchan == &lbolt) setrunnable(updateproc); - splx(s); + mtx_exit(&sched_lock, MTX_SPIN); if (rushjob < syncdelay / 2) { rushjob += 1; stat_rush_requests += 1; diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index a6bae88f2ada..f72095a11b81 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1103,12 +1103,11 @@ sched_sync(void) int speedup_syncer() { - int s; - s = splhigh(); + mtx_enter(&sched_lock, MTX_SPIN); if (updateproc->p_wchan == &lbolt) setrunnable(updateproc); - splx(s); + mtx_exit(&sched_lock, MTX_SPIN); if (rushjob < syncdelay / 2) { rushjob += 1; stat_rush_requests += 1;