summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcheloha <cheloha@openbsd.org>2020-01-24 06:31:17 +0000
committercheloha <cheloha@openbsd.org>2020-01-24 06:31:17 +0000
commitcbef7e11abb0e9c1f73e6873b214a833b9feba7d (patch)
tree3ca66282194ea4eb459aa3f2b5cdcb3a4e9cef29
parentprogress on rebound has been stalled long enough it's time to fade away. (diff)
downloadwireguard-openbsd-cbef7e11abb0e9c1f73e6873b214a833b9feba7d.tar.xz
wireguard-openbsd-cbef7e11abb0e9c1f73e6873b214a833b9feba7d.zip
pool(9): replace custom TAILQ concatenation loops with TAILQ_CONCAT(3)
TAILQ_CONCAT(3) apparently wasn't in-tree when this code was written. Using it leaves us with less code *and* better performance. ok tedu@
-rw-r--r--sys/kern/subr_pool.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c
index ede0cb45382..a2c941567f9 100644
--- a/sys/kern/subr_pool.c
+++ b/sys/kern/subr_pool.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_pool.c,v 1.229 2020/01/23 14:38:59 cheloha Exp $ */
+/* $OpenBSD: subr_pool.c,v 1.230 2020/01/24 06:31:17 cheloha Exp $ */
/* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */
/*-
@@ -649,11 +649,7 @@ pool_runqueue(struct pool *pp, int flags)
do {
pp->pr_requesting = 1;
- /* no TAILQ_JOIN? :( */
- while ((pr = TAILQ_FIRST(&pp->pr_requests)) != NULL) {
- TAILQ_REMOVE(&pp->pr_requests, pr, pr_entry);
- TAILQ_INSERT_TAIL(&prl, pr, pr_entry);
- }
+ TAILQ_CONCAT(&prl, &pp->pr_requests, pr_entry);
if (TAILQ_EMPTY(&prl))
continue;
@@ -684,11 +680,7 @@ pool_runqueue(struct pool *pp, int flags)
pl_enter(pp, &pp->pr_requests_lock);
} while (--pp->pr_requesting);
- /* no TAILQ_JOIN :( */
- while ((pr = TAILQ_FIRST(&prl)) != NULL) {
- TAILQ_REMOVE(&prl, pr, pr_entry);
- TAILQ_INSERT_TAIL(&pp->pr_requests, pr, pr_entry);
- }
+ TAILQ_CONCAT(&pp->pr_requests, &prl, pr_entry);
}
void *