Author: glebius
Date: Mon Feb  3 20:48:57 2020
New Revision: 357466
URL: https://svnweb.freebsd.org/changeset/base/357466

Log:
  Couple protocol drain routines (frag6_drain and sctp_drain) may send
  packets.  An unexpected behaviour for memory reclamation routine.
  Anyway, we need enter the network epoch for doing that.

Modified:
  head/sys/kern/kern_mbuf.c

Modified: head/sys/kern/kern_mbuf.c
==============================================================================
--- head/sys/kern/kern_mbuf.c   Mon Feb  3 20:46:31 2020        (r357465)
+++ head/sys/kern/kern_mbuf.c   Mon Feb  3 20:48:57 2020        (r357466)
@@ -829,15 +829,18 @@ mb_ctor_pack(void *mem, int size, void *arg, int how)
 static void
 mb_reclaim(uma_zone_t zone __unused, int pending __unused)
 {
+       struct epoch_tracker et;
        struct domain *dp;
        struct protosw *pr;
 
        WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK | WARN_PANIC, NULL, __func__);
 
+       NET_EPOCH_ENTER(et);
        for (dp = domains; dp != NULL; dp = dp->dom_next)
                for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
                        if (pr->pr_drain != NULL)
                                (*pr->pr_drain)();
+       NET_EPOCH_EXIT(et);
 }
 
 /*
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to