Source-Changes-HG archive

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

[src/trunk]: src/sys/kern - nextlwp: do not set l_cpu, it should be returned ...



details:   https://anonhg.NetBSD.org/src/rev/e2098da0cc22
branches:  trunk
changeset: 750423:e2098da0cc22
user:      rmind <rmind%NetBSD.org@localhost>
date:      Wed Dec 30 23:54:30 2009 +0000

description:
- nextlwp: do not set l_cpu, it should be returned correct (add assert).
- resched_cpu: avoid double set of ci.

diffstat:

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

diffs (37 lines):

diff -r b3dfcab47851 -r e2098da0cc22 sys/kern/kern_synch.c
--- a/sys/kern/kern_synch.c     Wed Dec 30 23:49:59 2009 +0000
+++ b/sys/kern/kern_synch.c     Wed Dec 30 23:54:30 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_synch.c,v 1.273 2009/12/05 22:38:19 pooka Exp $   */
+/*     $NetBSD: kern_synch.c,v 1.274 2009/12/30 23:54:30 rmind 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.273 2009/12/05 22:38:19 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.274 2009/12/30 23:54:30 rmind Exp $");
 
 #include "opt_kstack.h"
 #include "opt_perfctrs.h"
@@ -546,8 +546,8 @@
        if (newl != NULL) {
                sched_dequeue(newl);
                KASSERT(lwp_locked(newl, spc->spc_mutex));
+               KASSERT(newl->l_cpu == ci);
                newl->l_stat = LSONPROC;
-               newl->l_cpu = ci;
                newl->l_pflag |= LP_RUNNING;
                lwp_setlock(newl, spc->spc_lwplock);
        } else {
@@ -1079,7 +1079,7 @@
 static void
 resched_cpu(struct lwp *l)
 {
-       struct cpu_info *ci = ci = l->l_cpu;
+       struct cpu_info *ci = l->l_cpu;
 
        KASSERT(lwp_locked(l, NULL));
        if (lwp_eprio(l) > ci->ci_schedstate.spc_curpriority)



Home | Main Index | Thread Index | Old Index