summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2000-12-02 06:09:44 +0000
committerjhb <jhb@FreeBSD.org>2000-12-02 06:09:44 +0000
commit967c93e448a0314564254f068ea309b90d502e58 (patch)
tree3481284710ac990b647783054cc1e3bb358256d2 /sys
parentcec123a65f01d596240bf92f4286e279d51622fd (diff)
downloadFreeBSD-src-967c93e448a0314564254f068ea309b90d502e58.zip
FreeBSD-src-967c93e448a0314564254f068ea309b90d502e58.tar.gz
Protect p_stat with sched_lock.
Diffstat (limited to 'sys')
-rw-r--r--sys/vm/vm_pageout.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index 3b0c7cc..762b293 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -1143,9 +1143,12 @@ rescan0:
* if the process is in a non-running type state,
* don't touch it.
*/
+ mtx_enter(&sched_lock, MTX_SPIN);
if (p->p_stat != SRUN && p->p_stat != SSLEEP) {
+ mtx_exit(&sched_lock, MTX_SPIN);
continue;
}
+ mtx_exit(&sched_lock, MTX_SPIN);
/*
* get the process size
*/
@@ -1459,9 +1462,12 @@ vm_daemon()
* if the process is in a non-running type state,
* don't touch it.
*/
+ mtx_enter(&sched_lock, MTX_SPIN);
if (p->p_stat != SRUN && p->p_stat != SSLEEP) {
+ mtx_exit(&sched_lock, MTX_SPIN);
continue;
}
+ mtx_exit(&sched_lock, MTX_SPIN);
/*
* get a limit
*/
OpenPOWER on IntegriCloud