- Fix a comment: LSIDL is covered by spc_mutex, not spc_lwplock.

- mi_switch: Add a comment that spc_lwplock might not necessary be held.
This commit is contained in:
rmind 2007-10-13 00:30:26 +00:00
parent 337692921d
commit 6673d94694
2 changed files with 8 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_lwp.c,v 1.73 2007/10/09 19:00:13 rmind Exp $ */
/* $NetBSD: kern_lwp.c,v 1.74 2007/10/13 00:30:26 rmind Exp $ */
/*-
* Copyright (c) 2001, 2006, 2007 The NetBSD Foundation, Inc.
@ -158,12 +158,12 @@
*
* States and their associated locks:
*
* LSIDL, LSZOMB, LSONPROC:
* LSONPROC, LSZOMB:
*
* Always covered by spc_lwplock, which protects running LWPs.
* This is a per-CPU lock.
*
* LSRUN:
* LSIDL, LSRUN:
*
* Always covered by spc_mutex, which protects the run queues.
* This may be a per-CPU lock, depending on the scheduler.
@ -205,7 +205,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.73 2007/10/09 19:00:13 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.74 2007/10/13 00:30:26 rmind Exp $");
#include "opt_multiprocessor.h"
#include "opt_lockdebug.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_synch.c,v 1.200 2007/10/09 19:00:14 rmind Exp $ */
/* $NetBSD: kern_synch.c,v 1.201 2007/10/13 00:30:26 rmind Exp $ */
/*-
* Copyright (c) 1999, 2000, 2004, 2006, 2007 The NetBSD Foundation, Inc.
@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.200 2007/10/09 19:00:14 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.201 2007/10/13 00:30:26 rmind Exp $");
#include "opt_kstack.h"
#include "opt_lockdebug.h"
@ -429,8 +429,9 @@ mi_switch(lwp_t *l)
}
/*
* Let sched_nextlwp() select the LWP to run the CPU next.
* Let sched_nextlwp() select the LWP to run the CPU next.
* If no LWP is runnable, switch to the idle LWP.
* Note that spc_lwplock might not necessary be held.
*/
if (newl == NULL) {
newl = sched_nextlwp();