Date: Wed, 18 Aug 2021 09:47:09 GMT From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 86a96281df03 - stable/13 - frag6: do less work in frag6_slowtimo if possible Message-ID: <202108180947.17I9l98B078169@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=86a96281df03901f7930669c4ad488fab9ca64e1 commit 86a96281df03901f7930669c4ad488fab9ca64e1 Author: Mateusz Guzik <mjg@FreeBSD.org> AuthorDate: 2021-08-13 11:32:03 +0000 Commit: Mateusz Guzik <mjg@FreeBSD.org> CommitDate: 2021-08-18 09:44:45 +0000 frag6: do less work in frag6_slowtimo if possible frag6_slowtimo avoidably uses CPU on otherwise idle boxes Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31528 (cherry picked from commit 8afe9481cfa382337b8a885f358fe888bddf5982) --- sys/netinet6/frag6.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index ec35e98d25ec..222bd157fddd 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -891,10 +891,15 @@ frag6_slowtimo(void) struct ip6q *q6, *q6tmp; uint32_t bucket; + if (atomic_load_int(&frag6_nfrags) == 0) + return; + VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); for (bucket = 0; bucket < IP6REASS_NHASH; bucket++) { + if (V_ip6qb[bucket].count == 0) + continue; IP6QB_LOCK(bucket); head = IP6QB_HEAD(bucket); TAILQ_FOREACH_SAFE(q6, head, ip6q_tq, q6tmp)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108180947.17I9l98B078169>