1. 14 Jun, 2010 7 commits
    • Paul E. McKenney's avatar
      lockdep: Add an in_workqueue_context() lockdep-based test function · a25909a4
      Paul E. McKenney authored
      Some recent uses of RCU make use of workqueues.  In these uses, execution
      within the context of a specific workqueue takes the place of the usual
      RCU read-side primitives such as rcu_read_lock(), and flushing of workqueues
      takes the place of the usual RCU grace-period primitives.  Checking for
      correct use of rcu_dereference() in such cases requires a test of whether
      the code is executing in the context of a particular workqueue.  This
      commit adds an in_workqueue_context() function that provides this test.
      This new function is only defined when lockdep is enabled, which allows
      it to be used as the second argument of rcu_dereference_check().
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      a25909a4
    • Paul E. McKenney's avatar
      rcu: add __rcu API for later sparse checking · 71d1d5c7
      Paul E. McKenney authored
      This commit defines an __rcu API, but provides only vacuous definitions
      for it.  This breaks dependencies among most of the subsequent patches,
      allowing them to reach mainline asynchronously via whatever trees are
      appropriate.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Christopher Li <sparse@chrisli.org>
      Cc: Josh Triplett <josh@joshtriplett.org>
      71d1d5c7
    • Paul E. McKenney's avatar
      rcu: add an rcu_dereference_index_check() · f5155b33
      Paul E. McKenney authored
      The sparse RCU-pointer checking relies on type magic that dereferences
      the pointer in question.  This does not work if the pointer is in fact
      an array index.  This commit therefore supplies a new RCU API that
      omits the sparse checking to continue to support rcu_dereference()
      on integers.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      f5155b33
    • Mathieu Desnoyers's avatar
      tree/tiny rcu: Add debug RCU head objects · 551d55a9
      Mathieu Desnoyers authored
      Helps finding racy users of call_rcu(), which results in hangs because list
      entries are overwritten and/or skipped.
      
      Changelog since v4:
      - Bissectability is now OK
      - Now generate a WARN_ON_ONCE() for non-initialized rcu_head passed to
        call_rcu(). Statically initialized objects are detected with
        object_is_static().
      - Rename rcu_head_init_on_stack to init_rcu_head_on_stack.
      - Remove init_rcu_head() completely.
      
      Changelog since v3:
      - Include comments from Lai Jiangshan
      
      This new patch version is based on the debugobjects with the newly introduced
      "active state" tracker.
      
      Non-initialized entries are all considered as "statically initialized". An
      activation fixup (triggered by call_rcu()) takes care of performing the debug
      object initialization without issuing any warning. Since we cannot increase the
      size of struct rcu_head, I don't see much room to put an identifier for
      statically initialized rcu_head structures. So for now, we have to live without
      "activation without explicit init" detection. But the main purpose of this debug
      option is to detect double-activations (double call_rcu() use of a rcu_head
      before the callback is executed), which is correctly addressed here.
      
      This also detects potential internal RCU callback corruption, which would cause
      the callbacks to be executed twice.
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      CC: David S. Miller <davem@davemloft.net>
      CC: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      CC: akpm@linux-foundation.org
      CC: mingo@elte.hu
      CC: laijs@cn.fujitsu.com
      CC: dipankar@in.ibm.com
      CC: josh@joshtriplett.org
      CC: dvhltc@us.ibm.com
      CC: niv@us.ibm.com
      CC: tglx@linutronix.de
      CC: peterz@infradead.org
      CC: rostedt@goodmis.org
      CC: Valdis.Kletnieks@vt.edu
      CC: dhowells@redhat.com
      CC: eric.dumazet@gmail.com
      CC: Alexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Reviewed-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
      551d55a9
    • Paul E. McKenney's avatar
      mm: remove all rcu head initializations · 875352c9
      Paul E. McKenney authored
      Remove all rcu head inits. We don't care about the RCU head state before passing
      it to call_rcu() anyway. Only leave the "on_stack" variants so debugobjects can
      keep track of objects on stack.
      Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Christoph Lameter <cl@linux-foundation.org>
      Cc: Pekka Enberg <penberg@cs.helsinki.fi>
      Cc: Matt Mackall <mpm@selenic.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      875352c9
    • Paul E. McKenney's avatar
      fs: remove all rcu head initializations, except on_stack initializations · b97181f2
      Paul E. McKenney authored
      Remove all rcu head inits. We don't care about the RCU head state before passing
      it to call_rcu() anyway. Only leave the "on_stack" variants so debugobjects can
      keep track of objects on stack.
      Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Andries Brouwer <aeb@cwi.nl>
      b97181f2
    • Paul E. McKenney's avatar
      powerpc: remove all rcu head initializations · 9161e329
      Paul E. McKenney authored
      Remove all rcu head inits. We don't care about the RCU head state before passing
      it to call_rcu() anyway. Only leave the "on_stack" variants so debugobjects can
      keep track of objects on stack.
      Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      9161e329
  2. 12 Jun, 2010 1 commit
  3. 11 Jun, 2010 32 commits