summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1996-07-31 10:35:47 +0000
committerdg <dg@FreeBSD.org>1996-07-31 10:35:47 +0000
commit2fb389656a38e203c1cb72850a60f7c0b18aaf1c (patch)
tree94e4cbcf9b7727e2a642f5af295fbfe521a688b7 /sys/kern
parent2a50131bb0b7b79f7cdd0457a4a51e8b0e3a53c7 (diff)
downloadFreeBSD-src-2fb389656a38e203c1cb72850a60f7c0b18aaf1c.zip
FreeBSD-src-2fb389656a38e203c1cb72850a60f7c0b18aaf1c.tar.gz
Changed wakeup_one() to continue looping, possibly waking up additional
processes, until it finds one that is not swapped out. Submitted by: dyson
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_synch.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index b32fe03..4921bc8 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_synch.c 8.9 (Berkeley) 5/19/95
- * $Id: kern_synch.c,v 1.20 1996/04/07 13:35:58 bde Exp $
+ * $Id: kern_synch.c,v 1.21 1996/07/31 09:26:37 davidg Exp $
*/
#include "opt_ktrace.h"
@@ -472,7 +472,9 @@ restart:
}
/*
- * Make one process sleeping on the specified identifier runnable.
+ * Make a process sleeping on the specified identifier runnable.
+ * May wake more than one process if a target prcoess is currently
+ * swapped out.
*/
void
wakeup_one(ident)
@@ -499,19 +501,14 @@ wakeup_one(ident)
updatepri(p);
p->p_slptime = 0;
p->p_stat = SRUN;
- /*
- * XXX Perhaps we should only terminate the
- * loop if the process being awoken is memory
- * resident (i.e. actually runnable)?
- */
if (p->p_flag & P_INMEM) {
setrunqueue(p);
need_resched();
+ break;
} else {
wakeup((caddr_t)&proc0);
}
/* END INLINE EXPANSION */
- break;
}
}
}
OpenPOWER on IntegriCloud