summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2000-12-13 01:06:53 +0000
committermckusick <mckusick@FreeBSD.org>2000-12-13 01:06:53 +0000
commit8fb19aa301bf05a6d0e411ceb787bf9d53acf8a7 (patch)
tree9af378eb7c55fed4e7a28935cf5992a35163855d /sys
parenta2dc6debf4a9c4d3bef7882c26c63e0b0e5947c8 (diff)
downloadFreeBSD-src-8fb19aa301bf05a6d0e411ceb787bf9d53acf8a7.zip
FreeBSD-src-8fb19aa301bf05a6d0e411ceb787bf9d53acf8a7.tar.gz
Use proper mutex locking when calling setrunnable from speedup_syncer().
Submitted by: Tor.Egge@fast.no
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_export.c5
-rw-r--r--sys/kern/vfs_subr.c5
2 files changed, 4 insertions, 6 deletions
diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c
index a6bae88..f72095a 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 a6bae88..f72095a 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;
OpenPOWER on IntegriCloud