Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern sleepq_insert: call lwp_eprio only when necessary
details: https://anonhg.NetBSD.org/src/rev/0dd75c18fc0f
branches: trunk
changeset: 767662:0dd75c18fc0f
user: yamt <yamt%NetBSD.org@localhost>
date: Tue Jul 26 13:04:51 2011 +0000
description:
sleepq_insert: call lwp_eprio only when necessary
diffstat:
sys/kern/kern_sleepq.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diffs (32 lines):
diff -r 94bdf5caa44e -r 0dd75c18fc0f sys/kern/kern_sleepq.c
--- a/sys/kern/kern_sleepq.c Tue Jul 26 13:03:57 2011 +0000
+++ b/sys/kern/kern_sleepq.c Tue Jul 26 13:04:51 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_sleepq.c,v 1.39 2011/05/13 22:19:41 rmind Exp $ */
+/* $NetBSD: kern_sleepq.c,v 1.40 2011/07/26 13:04:51 yamt Exp $ */
/*-
* Copyright (c) 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sleepq.c,v 1.39 2011/05/13 22:19:41 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sleepq.c,v 1.40 2011/07/26 13:04:51 yamt Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -166,10 +166,11 @@
void
sleepq_insert(sleepq_t *sq, lwp_t *l, syncobj_t *sobj)
{
- lwp_t *l2;
- const int pri = lwp_eprio(l);
if ((sobj->sobj_flag & SOBJ_SLEEPQ_SORTED) != 0) {
+ lwp_t *l2;
+ const int pri = lwp_eprio(l);
+
TAILQ_FOREACH(l2, sq, l_sleepchain) {
if (lwp_eprio(l2) < pri) {
TAILQ_INSERT_BEFORE(l2, l, l_sleepchain);
Home |
Main Index |
Thread Index |
Old Index