Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern The SHOULDYIELD flag doesn't indicate that other LW...



details:   https://anonhg.NetBSD.org/src/rev/8a7fa4e65150
branches:  trunk
changeset: 446324:8a7fa4e65150
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Fri Nov 30 15:05:35 2018 +0000

description:
The SHOULDYIELD flag doesn't indicate that other LWPs could run but only
that the current LWP was seen on two consecutive scheduler intervals.

There are currently at least 3 cases for calling preempt().
- always call preempt()
- check the SHOULDYIELD flag
- check the real ci_want_resched

So the forced check for SHOULDYIELD changed the scheduler timing. Revert
it for now.

diffstat:

 sys/kern/kern_synch.c |  8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diffs (29 lines):

diff -r af0217ef0a19 -r 8a7fa4e65150 sys/kern/kern_synch.c
--- a/sys/kern/kern_synch.c     Fri Nov 30 14:07:30 2018 +0000
+++ b/sys/kern/kern_synch.c     Fri Nov 30 15:05:35 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_synch.c,v 1.321 2018/11/28 19:46:22 mlelstv Exp $ */
+/*     $NetBSD: kern_synch.c,v 1.322 2018/11/30 15:05:35 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009
@@ -69,7 +69,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.321 2018/11/28 19:46:22 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.322 2018/11/30 15:05:35 mlelstv Exp $");
 
 #include "opt_kstack.h"
 #include "opt_dtrace.h"
@@ -286,10 +286,6 @@
 {
        struct lwp *l = curlwp;
 
-       /* check if the scheduler has another LWP to run */
-       if ((l->l_cpu->ci_schedstate.spc_flags & SPCF_SHOULDYIELD) == 0)
-               return;
-
        KERNEL_UNLOCK_ALL(l, &l->l_biglocks);
        lwp_lock(l);
        KASSERT(lwp_locked(l, l->l_cpu->ci_schedstate.spc_lwplock));



Home | Main Index | Thread Index | Old Index