146: Mixing operations of RCU nested read sections of different types
RCU read sections nesting
Mixing operations of RCU nested read sections of different types
Nested RCU read sections are allowed by Linux documentation, one read section may contain inside another read section. Read section starts with rcu_read_lock and ends with rcu_read_unlock operation. It is prohibited to mix start of one type of section with end of another type of section. For example, it is prohibited to mix original RCU and RCU BH operations.
Example of incorrect behavior:
rcu_read_lock(); // starting original RCU section
rcu_read_lock_bh(); //starting RCU BH nested section
rcu_read_unlock(); //BUG: RCU BH section should be ended first!
Correct usage example: