]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Avoid calling protocol drain routines more than once per reclamation event.
authorjtl <jtl@FreeBSD.org>
Thu, 16 Apr 2020 20:17:24 +0000 (20:17 +0000)
committerjtl <jtl@FreeBSD.org>
Thu, 16 Apr 2020 20:17:24 +0000 (20:17 +0000)
commit4f694d5f49fbdc2466254f13ae3cfcf4a97ad512
tree726802419d8fdf4919cbe77fb05ec05adc0af013
parentdbbb9f24b0cc88578b32f0ae6c68934a28e5ebe4
Avoid calling protocol drain routines more than once per reclamation event.

mb_reclaim() calls the protocol drain routines for each protocol in each
domain. Some protocols exist in more than one domain and share drain
routines. In the case of SCTP, it also uses the same drain routine for
its SOCK_SEQPACKET and SOCK_STREAM entries in the same domain.

On systems with INET, INET6, and SCTP all defined, mb_reclaim() calls
sctp_drain() four times. On systems with INET and INET6 defined,
mb_reclaim() calls tcp_drain() twice. mb_reclaim() is the only in-tree
caller of the pr_drain protocol entry.

Eliminate this duplication by ensuring that each pr_drain routine is only
specified for one protocol entry in one domain.

Reviewed by: tuexen
MFC after: 2 weeks
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D24418
sys/netinet/in_proto.c
sys/netinet6/in6_proto.c