summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>1998-08-26 05:27:42 +0000
committerMatthew Dillon <dillon@FreeBSD.org>1998-08-26 05:27:42 +0000
commit8e519d1f35ba644028d53e8fd7c90293efdf1993 (patch)
treeaca8aae388083a718d0a707c07a93910d4bee5f8
parent842d9777070702323c7602b462383d2092b3b715 (diff)
Notes
-rw-r--r--sys/kern/kern_synch.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index 749595a05216..2d5105514a20 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.60 1998/07/11 13:06:41 bde Exp $
+ * $Id: kern_synch.c,v 1.61 1998/07/15 02:32:10 bde Exp $
*/
#include "opt_ktrace.h"
@@ -107,14 +107,21 @@ static void maybe_resched(struct proc *chk)
{
struct proc *p = curproc; /* XXX */
- /* If the current scheduler is the idle scheduler or
- * the priority of the new one is higher then reschedule.
+ /*
+ * Compare priorities if the new process is on the same scheduler,
+ * otherwise the one on the more realtimeish scheduler wins.
+ *
+ * XXX idle scheduler still broken because proccess stays on idle
+ * scheduler during waits (such as when getting FS locks). If a
+ * standard process becomes runaway cpu-bound, the system can lockup
+ * due to idle-scheduler processes in wakeup never getting any cpu.
*/
if (p == 0 ||
- RTP_PRIO_BASE(p->p_rtprio.type) == RTP_PRIO_IDLE ||
- (chk->p_priority < curpriority &&
- RTP_PRIO_BASE(p->p_rtprio.type) == RTP_PRIO_BASE(chk->p_rtprio.type)) )
+ (chk->p_priority < curpriority && RTP_PRIO_BASE(p->p_rtprio.type) == RTP_PRIO_BASE(chk->p_rtprio.type)) ||
+ RTP_PRIO_BASE(chk->p_rtprio.type) < RTP_PRIO_BASE(p->p_rtprio.type)
+ ) {
need_resched();
+ }
}
#define ROUNDROBIN_INTERVAL (hz / quantum)