Module Name:    src
Committed By:   rmind
Date:           Wed Dec 30 23:54:30 UTC 2009

Modified Files:
        src/sys/kern: kern_synch.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.273 -r1.274 src/sys/kern/kern_synch.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_synch.c
diff -u src/sys/kern/kern_synch.c:1.273 src/sys/kern/kern_synch.c:1.274
--- src/sys/kern/kern_synch.c:1.273	Sat Dec  5 22:38:19 2009
+++ src/sys/kern/kern_synch.c	Wed Dec 30 23:54:30 2009
@@ -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)

Reply via email to