HomeFreeBSD

Avoid calling protocol drain routines more than once per reclamation event.

Description

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

Details

Provenance
jtlAuthored on
Reviewer
tuexen
Differential Revision
D24418: Avoid calling protocol drain routines more than once
Parents
rS360019: Add a regression test for the changes in r359922 and r359923.
Branches
Unknown
Tags
Unknown