At 2024-01-11 16:25:46, "Jozsef Kadlecsik" <kadlec@xxxxxxxxxxxxxxxxx> wrote: >Hi, > > >Could you check that the patch below fixes the performance regression? >Instead of waiting for the RCU grace period at swapping, call_rcu() is >used at destroying the set. Got a compiler error: net/netfilter/ipset/ip_set_core.c: In function ‘ip_set_destroy_set_rcu’: net/netfilter/ipset/ip_set_core.c:1017:9: error: implicit declaration of function ‘ip_set_destroy_set’; did you mean ‘ip_set_destroy_set_rcu’? [-Werror=implicit-function-declaration] 1017 | ip_set_destroy_set(set); | ^~~~~~~~~~~~~~~~~~ | ip_set_destroy_set_rcu net/netfilter/ipset/ip_set_core.c: At top level: net/netfilter/ipset/ip_set_core.c:1183:1: warning: conflicting types for ‘ip_set_destroy_set’; have ‘void(struct ip_set *)’ 1183 | ip_set_destroy_set(struct ip_set *set) | ^~~~~~~~~~~~~~~~~~ net/netfilter/ipset/ip_set_core.c:1183:1: error: static declaration of ‘ip_set_destroy_set’ follows non-static declaration I move the declaration of ip_set_destroy_set_rcu, make sure it is after the declaration of ip_set_destroy_set, With this path, the performance degradation of ipset_swap is gone, but my test only stress ipset_swap, not a swap/destroy sequence. I will adjust my code to stress a full swap/destroy/create/add sequence, and update later. Thanks David