Date: Wed, 18 Aug 2021 09:47:07 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: 990e592daeb3 - stable/13 - ip_reass: do less work in ipreass_slowtimo if possible Message-ID: <202108180947.17I9l7C4078120@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=990e592daeb3aa7aad1881d999a6b95c15320df7 commit 990e592daeb3aa7aad1881d999a6b95c15320df7 Author: Mateusz Guzik <mjg@FreeBSD.org> AuthorDate: 2021-08-13 09:32:16 +0000 Commit: Mateusz Guzik <mjg@FreeBSD.org> CommitDate: 2021-08-18 09:44:44 +0000 ip_reass: do less work in ipreass_slowtimo if possible ipreass_slowtimo avoidably uses CPU on otherwise idle boxes Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31526 (cherry picked from commit 3be3cbe06d6107486d67d8eb80480d34d084c39c) --- sys/netinet/ip_reass.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/netinet/ip_reass.c b/sys/netinet/ip_reass.c index 8a071345677a..db32e6a312f2 100644 --- a/sys/netinet/ip_reass.c +++ b/sys/netinet/ip_reass.c @@ -593,11 +593,16 @@ ipreass_slowtimo(void) { struct ipq *fp, *tmp; + if (atomic_load_int(&nfrags) == 0) + return; + for (int i = 0; i < IPREASS_NHASH; i++) { + if (TAILQ_EMPTY(&V_ipq[i].head)) + continue; IPQ_LOCK(i); TAILQ_FOREACH_SAFE(fp, &V_ipq[i].head, ipq_list, tmp) if (--fp->ipq_ttl == 0) - ipq_timeout(&V_ipq[i], fp); + ipq_timeout(&V_ipq[i], fp); IPQ_UNLOCK(i); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108180947.17I9l7C4078120>