diff options
author | 2015-11-19 13:19:24 +0000 | |
---|---|---|
committer | 2015-11-19 13:19:24 +0000 | |
commit | 08dae4e54ce3cecb3b3ab6f928aec19c588de54b (patch) | |
tree | eb9e40d342aadda9aa13602d0ec221da8eea22d8 | |
parent | get rid of sc_tx_free and the atomic ops on it in myx_start and myx_txeof. (diff) | |
download | wireguard-openbsd-08dae4e54ce3cecb3b3ab6f928aec19c588de54b.tar.xz wireguard-openbsd-08dae4e54ce3cecb3b3ab6f928aec19c588de54b.zip |
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
-rw-r--r-- | sys/kern/kern_task.c | 4 |
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); |