There are many RCU functions that don't have a _bh counterpart.
Examples are:
list_entry_rcu()
list_for_each_entry_rcu()
Is this because...
- they can be called from bottom halves just fine (think
list_empty()
vslist_empty_rcu()
)?- Does this mean I can use
rcu_read_lock()
andrcu_read_lock_bh()
interchangeably in these cases?
- Does this mean I can use
- no one has so far needed them (and therefore I's supposed to roll out my own version of them)?
Rule 9 of the RCU checklist says "in which case the matching rcu_dereference()
primitive must be used in order to keep lockdep happy". So I guess the second option above is true. But then I find code that reads like this:
rcu_read_lock_bh();
c = __clusterip_config_find(clusterip);
And then, during __clusterip_config_find()
:
list_for_each_entry_rcu(c, &clusterip_configs, list) {
What is going on!? list_for_each_entry_rcu()
uses rcu_dereference_check()
, not rcu_dereference_bh_check()
...