netfilter: ipset: fix performance regression in swap operation
The patch "netfilter: ipset: fix race condition between swap/destroy and kernel side add/del/test", commit 28628fa9 fixes a race condition. But the synchronize_rcu() added to the swap function unnecessarily slows it down: it can safely be moved to destroy and use call_rcu() instead. Eric Dumazet pointed out that simply calling the destroy functions as rcu callback does not work: sets with timeout use garbage collectors which need cancelling at destroy which can wait. Therefore the destroy functions are split into two: cancelling garbage collectors safely at executing the command received by netlink and moving the remaining part only into the rcu callback. Link: https://lore.kernel.org/lkml/C0829B10-EAA6-4809-874E-E1E9C05A8D84@automattic.com/ Fixes: 28628fa9 ("netfilter: ipset: fix race condition between swap/destroy and kernel side add/del/test") Reported-by: Ale Crismani <ale.crismani@automattic.com> Reported-by: David Wang <00107082@163.com> Tested-by: David Wang <00107082@163.com> Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
parent
6e348067
-
mentioned in commit 27c5a095
-
mentioned in commit a24d5f2a
-
mentioned in commit c80ddc10
-
mentioned in commit c2dc077d
-
mentioned in commit b9aafef7
-
mentioned in commit c7f2733e
-
mentioned in commit 6587af96
-
mentioned in commit 653bc5e6
-
mentioned in commit ebc442c6
-
mentioned in commit b93a6756
-
mentioned in commit 4480ead6
-
mentioned in commit 970709a6
-
mentioned in commit 46fe5e8b
-
mentioned in commit 5278e435
-
mentioned in commit 6f313a33
-
mentioned in commit 4e7aaa6b
-
mentioned in commit 390b353d
-
mentioned in commit 4440ef0f
-
mentioned in commit 922b824b
Please register or sign in to comment