The branch main has been updated by mjg:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=3be3cbe06d6107486d67d8eb80480d34d084c39c

commit 3be3cbe06d6107486d67d8eb80480d34d084c39c
Author:     Mateusz Guzik <[email protected]>
AuthorDate: 2021-08-13 09:32:16 +0000
Commit:     Mateusz Guzik <[email protected]>
CommitDate: 2021-08-14 16:50:12 +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
---
 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);
        }
 }
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to