summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2015-11-19 13:19:25 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2015-11-19 13:19:25 +0000
commit80012f834ed619eae8c5e7ef5f535563eabf18a7 (patch)
tree2ef245c4a98dbec3b4891a6ffa304e978f57febe /sys
parent5b6a3d525b50d140f49ca5ca0ca9a973baf78a00 (diff)
dont try and wakeup other threads to handle pending work when we
know there's only one thread in the taskq. wakeups are much more expensive than a simple compare. from haesbart
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_task.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_task.c b/sys/kern/kern_task.c
index 8c736bd9679..15ca0486ec0 100644
--- a/sys/kern/kern_task.c
+++ b/sys/kern/kern_task.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_task.c,v 1.14 2015/02/09 03:15:41 dlg Exp $ */
+/* $OpenBSD: kern_task.c,v 1.15 2015/11/19 13:19:24 dlg Exp $ */
/*
* Copyright (c) 2013 David Gwynne <dlg@openbsd.org>
@@ -264,7 +264,7 @@ taskq_next_work(struct taskq *tq, struct task *work, sleepfn tqsleep)
next = TAILQ_FIRST(&tq->tq_worklist);
mtx_leave(&tq->tq_mtx);
- if (next != NULL)
+ if (next != NULL && tq->tq_nthreads > 1)
wakeup_one(tq);
return (1);