From 45ece682fdf58bb78484df9ad18f6bc1753e5072 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 25 Jan 2001 01:38:09 +0000 Subject: [PATCH] - Doh, lock faultin() with proc lock in scheduler(). - Lock p_swtime with sched_lock in scheduler() as well. --- sys/vm/vm_glue.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index f9154030615..b76c855d1d3 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; }