protosw: retire pr_drain and use EVENTHANDLER(9) directly
authorGleb Smirnoff <glebius@FreeBSD.org>
Wed, 17 Aug 2022 18:50:31 +0000 (11:50 -0700)
committerGleb Smirnoff <glebius@FreeBSD.org>
Wed, 17 Aug 2022 18:50:31 +0000 (11:50 -0700)
commit81a34d374ed6e5a7b14f24583bc8e3abfdc66306
treeb871f521eb454f414e41f126f2d9f02eb9220baa
parent1922eb3e9c23522ed323d022bac8456bf08b97cf
protosw: retire pr_drain and use EVENTHANDLER(9) directly

The method was called for two different conditions: 1) the VM layer is
low on pages or 2) one of UMA zones of mbuf allocator exhausted.
This change 2) into a new event handler, but all affected network
subsystems modified to subscribe to both, so this change shall not
bring functional changes under different low memory situations.

There were three subsystems still using pr_drain: TCP, SCTP and frag6.
The latter had its protosw entry for the only reason to register its
pr_drain method.

Reviewed by: tuexen, melifaro
Differential revision: https://reviews.freebsd.org/D36164
18 files changed:
sys/kern/kern_mbuf.c
sys/kern/uipc_debug.c
sys/kern/uipc_domain.c
sys/netinet/in_proto.c
sys/netinet/ip_input.c
sys/netinet/ip_reass.c
sys/netinet/ip_var.h
sys/netinet/sctp_module.c
sys/netinet/sctp_pcb.c
sys/netinet/sctp_pcb.h
sys/netinet/sctp_var.h
sys/netinet/tcp_subr.c
sys/netinet/tcp_var.h
sys/netinet6/in6_proto.c
sys/netinet6/ip6_input.c
sys/sys/eventhandler.h
sys/sys/protosw.h
sys/vm/vm_pageout.h