mirror of
https://github.com/torvalds/linux.git
synced 2024-11-15 00:21:59 +00:00
c1aa38866b
nft_set_lookup_byid() is very slow when transaction becomes large, due to
walk of the transaction list.
Add a dedicated list that contains only the new sets.
Before: nft -f ruleset 0.07s user 0.00s system 0% cpu 1:04.84 total
After: nft -f ruleset 0.07s user 0.00s system 0% cpu 30.115 total
.. where ruleset contains ~10 sets with ~100k elements.
The above number is for a combined flush+reload of the ruleset.
With previous flush, even the first NEWELEM has to walk through a few
hundred thousands of DELSET(ELEM) transactions before the first NEWSET
object. To cope with random-order-newset-newsetelem we'd need to replace
commit_set_list with a hashtable.
Expectation is that a NEWELEM operation refers to the most recently added
set, so last entry of the dedicated list should be the set we want.
NB: This is not a bug fix per se (functionality is fine), but with
larger transaction batches list search takes forever, so it would be
nice to speed this up for -stable too, hence adding a "fixes" tag.
Fixes:
|
||
---|---|---|
.. | ||
ipv4 | ||
ipv6 | ||
br_netfilter.h | ||
nf_bpf_link.h | ||
nf_conntrack_acct.h | ||
nf_conntrack_act_ct.h | ||
nf_conntrack_bpf.h | ||
nf_conntrack_bridge.h | ||
nf_conntrack_core.h | ||
nf_conntrack_count.h | ||
nf_conntrack_ecache.h | ||
nf_conntrack_expect.h | ||
nf_conntrack_extend.h | ||
nf_conntrack_helper.h | ||
nf_conntrack_l4proto.h | ||
nf_conntrack_labels.h | ||
nf_conntrack_seqadj.h | ||
nf_conntrack_synproxy.h | ||
nf_conntrack_timeout.h | ||
nf_conntrack_timestamp.h | ||
nf_conntrack_tuple.h | ||
nf_conntrack_zones.h | ||
nf_conntrack.h | ||
nf_dup_netdev.h | ||
nf_flow_table.h | ||
nf_hooks_lwtunnel.h | ||
nf_log.h | ||
nf_nat_helper.h | ||
nf_nat_masquerade.h | ||
nf_nat_redirect.h | ||
nf_nat.h | ||
nf_queue.h | ||
nf_reject.h | ||
nf_socket.h | ||
nf_synproxy.h | ||
nf_tables_core.h | ||
nf_tables_ipv4.h | ||
nf_tables_ipv6.h | ||
nf_tables_offload.h | ||
nf_tables.h | ||
nf_tproxy.h | ||
nft_fib.h | ||
nft_meta.h | ||
nft_reject.h | ||
xt_rateest.h |