summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-01-25 01:38:09 +0000
committerjhb <jhb@FreeBSD.org>2001-01-25 01:38:09 +0000
commitef07536d233ec236c198cf6e4d2fe450a02b3847 (patch)
treeea4b9bef085e75ce003f5acdb1116330bf7238d6 /sys
parent238ea9ee91a25c8c75403e2864930a6ba1e0512d (diff)
downloadFreeBSD-src-ef07536d233ec236c198cf6e4d2fe450a02b3847.zip
FreeBSD-src-ef07536d233ec236c198cf6e4d2fe450a02b3847.tar.gz
- Doh, lock faultin() with proc lock in scheduler().
- Lock p_swtime with sched_lock in scheduler() as well.
Diffstat (limited to 'sys')
-rw-r--r--sys/vm/vm_glue.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index f915403..b76c855 100644
--- a/sys/vm/vm_glue.c
+++ b/sys/vm/vm_glue.c
@@ -318,10 +318,12 @@ faultin(p)
++p->p_lock;
mtx_exit(&sched_lock, MTX_SPIN);
+ PROC_UNLOCK(p);
mtx_assert(&Giant, MA_OWNED);
pmap_swapin_proc(p);
+ PROC_LOCK(p);
mtx_enter(&sched_lock, MTX_SPIN);
if (p->p_stat == SRUN) {
setrunqueue(p);
@@ -401,8 +403,12 @@ loop:
/*
* We would like to bring someone in. (only if there is space).
*/
+ PROC_LOCK(p);
faultin(p);
+ PROC_UNLOCK(p);
+ mtx_enter(&sched_lock, MTX_SPIN);
p->p_swtime = 0;
+ mtx_exit(&sched_lock, MTX_SPIN);
goto loop;
}
OpenPOWER on IntegriCloud