Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: Replace call_rcu_bh(), rcu_barrier_bh(), and synchronize_rcu_bh()

Now that call_rcu()'s callback is not invoked until after bh-disable
regions of code have completed (in addition to explicitly marked
RCU read-side critical sections), call_rcu() can be used in place
of call_rcu_bh(). Similarly, rcu_barrier() can be used in place of
rcu_barrier_bh() and synchronize_rcu() in place of synchronize_rcu_bh().
This commit therefore makes these changes.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

Paul E. McKenney and committed by
Pablo Neira Ayuso
c8d1da40 b9660987

+8 -8
+3 -3
net/ipv4/netfilter/ipt_CLUSTERIP.c
··· 94 94 clusterip_config_put(struct clusterip_config *c) 95 95 { 96 96 if (refcount_dec_and_test(&c->refcount)) 97 - call_rcu_bh(&c->rcu, clusterip_config_rcu_free); 97 + call_rcu(&c->rcu, clusterip_config_rcu_free); 98 98 } 99 99 100 100 /* decrease the count of entries using/referencing this config. If last ··· 876 876 xt_unregister_target(&clusterip_tg_reg); 877 877 unregister_pernet_subsys(&clusterip_net_ops); 878 878 879 - /* Wait for completion of call_rcu_bh()'s (clusterip_config_rcu_free) */ 880 - rcu_barrier_bh(); 879 + /* Wait for completion of call_rcu()'s (clusterip_config_rcu_free) */ 880 + rcu_barrier(); 881 881 } 882 882 883 883 module_init(clusterip_tg_init);
+2 -2
net/netfilter/ipset/ip_set_hash_gen.h
··· 67 67 68 68 /* A hash bucket */ 69 69 struct hbucket { 70 - struct rcu_head rcu; /* for call_rcu_bh */ 70 + struct rcu_head rcu; /* for call_rcu */ 71 71 /* Which positions are used in the array */ 72 72 DECLARE_BITMAP(used, AHASH_MAX_TUNED); 73 73 u8 size; /* size of the array */ ··· 664 664 spin_unlock_bh(&set->lock); 665 665 666 666 /* Give time to other readers of the set */ 667 - synchronize_rcu_bh(); 667 + synchronize_rcu(); 668 668 669 669 pr_debug("set %s resized from %u (%p) to %u (%p)\n", set->name, 670 670 orig->htable_bits, orig, t->htable_bits, t);
+2 -2
net/netfilter/xt_hashlimit.c
··· 260 260 dsthash_free(struct xt_hashlimit_htable *ht, struct dsthash_ent *ent) 261 261 { 262 262 hlist_del_rcu(&ent->node); 263 - call_rcu_bh(&ent->rcu, dsthash_free_rcu); 263 + call_rcu(&ent->rcu, dsthash_free_rcu); 264 264 ht->count--; 265 265 } 266 266 static void htable_gc(struct work_struct *work); ··· 1329 1329 xt_unregister_matches(hashlimit_mt_reg, ARRAY_SIZE(hashlimit_mt_reg)); 1330 1330 unregister_pernet_subsys(&hashlimit_net_ops); 1331 1331 1332 - rcu_barrier_bh(); 1332 + rcu_barrier(); 1333 1333 kmem_cache_destroy(hashlimit_cachep); 1334 1334 } 1335 1335