mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-01 16:14:13 +08:00
95d1815f09
Pablo Neira Ayuso says: ==================== Netfilter/IPVS updates for net-next 1) Incorrect error check in nft_expr_inner_parse(), from Dan Carpenter. 2) Add DATA_SENT state to SCTP connection tracking helper, from Sriram Yagnaraman. 3) Consolidate nf_confirm for ipv4 and ipv6, from Florian Westphal. 4) Add bitmask support for ipset, from Vishwanath Pai. 5) Handle icmpv6 redirects as RELATED, from Florian Westphal. 6) Add WARN_ON_ONCE() to impossible case in flowtable datapath, from Li Qiong. 7) A large batch of IPVS updates to replace timer-based estimators by kthreads to scale up wrt. CPUs and workload (millions of estimators). Julian Anastasov says: This patchset implements stats estimation in kthread context. It replaces the code that runs on single CPU in timer context every 2 seconds and causing latency splats as shown in reports [1], [2], [3]. The solution targets setups with thousands of IPVS services, destinations and multi-CPU boxes. Spread the estimation on multiple (configured) CPUs and multiple time slots (timer ticks) by using multiple chains organized under RCU rules. When stats are not needed, it is recommended to use run_estimation=0 as already implemented before this change. RCU Locking: - As stats are now RCU-locked, tot_stats, svc and dest which hold estimator structures are now always freed from RCU callback. This ensures RCU grace period after the ip_vs_stop_estimator() call. Kthread data: - every kthread works over its own data structure and all such structures are attached to array. For now we limit kthreads depending on the number of CPUs. - even while there can be a kthread structure, its task may not be running, eg. before first service is added or while the sysctl var is set to an empty cpulist or when run_estimation is set to 0 to disable the estimation. - the allocated kthread context may grow from 1 to 50 allocated structures for timer ticks which saves memory for setups with small number of estimators - a task and its structure may be released if all estimators are unlinked from its chains, leaving the slot in the array empty - every kthread data structure allows limited number of estimators. Kthread 0 is also used to initially calculate the max number of estimators to allow in every chain considering a sub-100 microsecond cond_resched rate. This number can be from 1 to hundreds. - kthread 0 has an additional job of optimizing the adding of estimators: they are first added in temp list (est_temp_list) and later kthread 0 distributes them to other kthreads. The optimization is based on the fact that newly added estimator should be estimated after 2 seconds, so we have the time to offload the adding to chain from controlling process to kthread 0. - to add new estimators we use the last added kthread context (est_add_ktid). The new estimators are linked to the chains just before the estimated one, based on add_row. This ensures their estimation will start after 2 seconds. If estimators are added in bursts, common case if all services and dests are initially configured, we may spread the estimators to more chains and as result, reducing the initial delay below 2 seconds. Many thanks to Jiri Wiesner for his valuable comments and for spending a lot of time reviewing and testing the changes on different platforms with 48-256 CPUs and 1-8 NUMA nodes under different cpufreq governors. The new IPVS estimators do not use workqueue infrastructure because: - The estimation can take long time when using multiple IPVS rules (eg. millions estimator structures) and especially when box has multiple CPUs due to the for_each_possible_cpu usage that expects packets from any CPU. With est_nice sysctl we have more control how to prioritize the estimation kthreads compared to other processes/kthreads that have latency requirements (such as servers). As a benefit, we can see these kthreads in top and decide if we will need some further control to limit their CPU usage (max number of structure to estimate per kthread). - with kthreads we run code that is read-mostly, no write/lock operations to process the estimators in 2-second intervals. - work items are one-shot: as estimators are processed every 2 seconds, they need to be re-added every time. This again loads the timers (add_timer) if we use delayed works, as there are no kthreads to do the timings. [1] Report from Yunhong Jiang: https://lore.kernel.org/netdev/D25792C1-1B89-45DE-9F10-EC350DC04ADC@gmail.com/ [2] https://marc.info/?l=linux-virtual-server&m=159679809118027&w=2 [3] Report from Dust: https://archive.linuxvirtualserver.org/html/lvs-devel/2020-12/msg00000.html * git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next: ipvs: run_estimation should control the kthread tasks ipvs: add est_cpulist and est_nice sysctl vars ipvs: use kthreads for stats estimation ipvs: use u64_stats_t for the per-cpu counters ipvs: use common functions for stats allocation ipvs: add rcu protection to stats netfilter: flowtable: add a 'default' case to flowtable datapath netfilter: conntrack: set icmpv6 redirects as RELATED netfilter: ipset: Add support for new bitmask parameter netfilter: conntrack: merge ipv4+ipv6 confirm functions netfilter: conntrack: add sctp DATA_SENT state netfilter: nft_inner: fix IS_ERR() vs NULL check ==================== Link: https://lore.kernel.org/r/20221211101204.1751-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> |
||
---|---|---|
.. | ||
caif | ||
device_drivers | ||
devlink | ||
dsa | ||
mac80211_hwsim | ||
6lowpan.rst | ||
6pack.rst | ||
af_xdp.rst | ||
alias.rst | ||
arcnet-hardware.rst | ||
arcnet.rst | ||
atm.rst | ||
ax25.rst | ||
bareudp.rst | ||
batman-adv.rst | ||
bonding.rst | ||
bridge.rst | ||
can_ucan_protocol.rst | ||
can.rst | ||
cdc_mbim.rst | ||
checksum-offloads.rst | ||
dccp.rst | ||
dctcp.rst | ||
dns_resolver.rst | ||
driver.rst | ||
eql.rst | ||
ethtool-netlink.rst | ||
failover.rst | ||
fib_trie.rst | ||
filter.rst | ||
gen_stats.rst | ||
generic_netlink.rst | ||
generic-hdlc.rst | ||
gtp.rst | ||
ieee802154.rst | ||
ila.rst | ||
index.rst | ||
ioam6-sysctl.rst | ||
ip_dynaddr.rst | ||
ip-sysctl.rst | ||
ipddp.rst | ||
ipsec.rst | ||
ipv6.rst | ||
ipvlan.rst | ||
ipvs-sysctl.rst | ||
j1939.rst | ||
kapi.rst | ||
kcm.rst | ||
l2tp.rst | ||
lapb-module.rst | ||
mac80211-auth-assoc-deauth.txt | ||
mac80211-injection.rst | ||
mctp.rst | ||
mpls-sysctl.rst | ||
mptcp-sysctl.rst | ||
msg_zerocopy.rst | ||
multiqueue.rst | ||
net_dim.rst | ||
net_failover.rst | ||
netconsole.rst | ||
netdev-features.rst | ||
netdevices.rst | ||
netfilter-sysctl.rst | ||
netif-msg.rst | ||
nexthop-group-resilient.rst | ||
nf_conntrack-sysctl.rst | ||
nf_flowtable.rst | ||
nfc.rst | ||
openvswitch.rst | ||
operstates.rst | ||
packet_mmap.rst | ||
page_pool.rst | ||
phonet.rst | ||
phy.rst | ||
pktgen.rst | ||
plip.rst | ||
ppp_generic.rst | ||
proc_net_tcp.rst | ||
radiotap-headers.rst | ||
rds.rst | ||
regulatory.rst | ||
representors.rst | ||
rxrpc.rst | ||
scaling.rst | ||
sctp.rst | ||
secid.rst | ||
seg6-sysctl.rst | ||
segmentation-offloads.rst | ||
sfp-phylink.rst | ||
skbuff.rst | ||
smc-sysctl.rst | ||
snmp_counter.rst | ||
statistics.rst | ||
strparser.rst | ||
switchdev.rst | ||
sysfs-tagging.rst | ||
tc-actions-env-rules.rst | ||
tc-queue-filters.rst | ||
tcp-thin.rst | ||
team.rst | ||
timestamping.rst | ||
tipc.rst | ||
tls-offload-layers.svg | ||
tls-offload-reorder-bad.svg | ||
tls-offload-reorder-good.svg | ||
tls-offload.rst | ||
tls.rst | ||
tproxy.rst | ||
tuntap.rst | ||
udplite.rst | ||
vrf.rst | ||
vxlan.rst | ||
x25-iface.rst | ||
x25.rst | ||
xfrm_device.rst | ||
xfrm_proc.rst | ||
xfrm_sync.rst | ||
xfrm_sysctl.rst |