LWN.net Logo

RCU mistakes, four years on

RCU mistakes, four years on

Posted Dec 17, 2009 18:03 UTC (Thu) by PaulMcKenney (subscriber, #9624)
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_sched() and 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 preempt_disable() for 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.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds