RCU mistakes, four years on
Posted Dec 17, 2009 18:03 UTC (Thu) by PaulMcKenney
Parent article: RCU mistakes
First, thank you for calling attention to this! The idea that disabling of preemption could stand in for
rcu_read_lock() is disturbingly widespread.
Disabling preemption was indeed a legal substitute for
rcu_read_lock() — in 2.6.11 and earlier.
This ended back in 2005 (2.6.12-rc4) with the deprecation of
synchronize_kernel() in favor of
synchronize_rcu(). As you say, this change was motivated by real-time-response considerations.
However, it was not until 2007, with the appearance of preemptible RCU in 2.6.25, that failure would appear in mainline due to (incorrectly) substituting
rcu_read_lock(). The theory was that these were found and fixed by the -rt effort, but clearly we did miss some.
I have therefore started working on lockdep extensions to allow automatic detection of this sort of RCU abuse, inspired by earlier patches from Peter Zijlstra and Thomas Gleixner. This patchset contains a crude (and buggy) first step in this direction.
A list of what RCU read-side primitives go with which RCU update primitives may be found in Documentation/RCU/whatisRCU.txt, search for “FULL LIST OF RCU APIs” and scroll down a bit.
to post comments)