1. 19 May, 2008 9 commits
    • Paul E. McKenney's avatar
      rcu: fix rcu_try_flip_waitack_needed() to prevent grace-period stall · d7c06513
      Paul E. McKenney authored
      The comment was correct -- need to make the code match the comment.
      Without this patch, if a CPU goes dynticks idle (and stays there forever)
      in just the right phase of preemptible-RCU grace-period processing,
      grace periods stall.  The offending sequence of events (courtesy
      of Promela/spin, at least after I got the liveness criterion coded
      correctly...) is as follows:
      
      o	CPU 0 is in dynticks-idle mode.  Its dynticks_progress_counter
      	is (say) 10.
      
      o	CPU 0 takes an interrupt, so rcu_irq_enter() increments CPU 0's
      	dynticks_progress_counter to 11.
      
      o	CPU 1 is doing RCU grace-period processing in rcu_try_flip_idle(),
      	sees rcu_pending(), so invokes dyntick_save_progress_counter(),
      	which in turn takes a snapshot of CPU 0's dynticks_progress_counter
      	into CPU 0's rcu_dyntick_snapshot -- now set to 11.  CPU 1 then
      	updates the RCU grace-period state to rcu_try_flip_waitack().
      
      o	CPU 0 returns from its interrupt, so rcu_irq_exit() increments
      	CPU 0's dynticks_progress_counter to 12.
      
      o	CPU 1 later invokes rcu_try_flip_waitack(), which notices that
      	CPU 0 has not yet responded, and hence in turn invokes
      	rcu_try_flip_waitack_needed().  This function examines the
      	state of CPU 0's dynticks_progress_counter and rcu_dyntick_snapshot
      	variables, which it copies to curr (== 12) and snap (== 11),
      	respectively.
      
      	Because curr!=snap, the first condition fails.
      
      	Because curr-snap is only 1 and snap is odd, the second
      	condition fails.
      
      	rcu_try_flip_waitack_needed() therefore incorrectly concludes
      	that it must wait for CPU 0 to explicitly acknowledge the
      	counter flip.
      
      o	CPU 0 remains forever in dynticks-idle mode, never taking
      	any more hardware interrupts or any NMIs, and never running
      	any more tasks.  (Of course, -something- will usually eventually
      	happen, which might be why we haven't seen this one in the
      	wild.  Still should be fixed!)
      
      Therefore the grace period never ends.  Fix is to make the code match
      the comment, as shown below.  With this fix, the above scenario
      would be satisfied with curr being even, and allow the grace period
      to proceed.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Josh Triplett <josh@kernel.org>
      Cc: Dipankar Sarma <dipankar@in.ibm.com>
      Cc: <stable@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      d7c06513
    • Franck Bui-Huu's avatar
      rculist.h: use the rcu API · 10aa9d2c
      Franck Bui-Huu authored
      Make almost all list mutation primitives use rcu_assign_pointer().
      
      The main point of this being readability improvement.
      Signed-off-by: default avatarFranck Bui-Huu <fbuihuu@gmail.com>
      Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
      Cc: Josh Triplett <josh@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      10aa9d2c
    • Franck Bui-Huu's avatar
      rcu: split list.h and move rcu-protected lists into rculist.h · 82524746
      Franck Bui-Huu authored
      Move rcu-protected lists from list.h into a new header file rculist.h.
      
      This is done because list are a very used primitive structure all over the
      kernel and it's currently impossible to include other header files in this
      list.h without creating some circular dependencies.
      
      For example, list.h implements rcu-protected list and uses rcu_dereference()
      without including rcupdate.h.  It actually compiles because users of
      rcu_dereference() are macros.  Others RCU functions could be used too but
      aren't probably because of this.
      
      Therefore this patch creates rculist.h which includes rcupdates without to
      many changes/troubles.
      Signed-off-by: default avatarFranck Bui-Huu <fbuihuu@gmail.com>
      Acked-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Acked-by: default avatarJosh Triplett <josh@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      82524746
    • Paul E. McKenney's avatar
      sched: 1Q08 RCU doc update, add call_rcu_sched() · 32300751
      Paul E. McKenney authored
      Long-delayed update to the RCU documentation, including adding the new
      call_rcu_sched() and rcu_barrier_sched() APIs.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      32300751
    • Paul E. McKenney's avatar
      rcu: add call_rcu_sched() and friends to rcutorture · 2326974d
      Paul E. McKenney authored
      Add entry to rcu_torture_ops allowing the correct barrier function to
      be used upon exit from rcutorture.  Also add torture options for the
      new call_rcu_sched() API.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      2326974d
    • Paul E. McKenney's avatar
      rcu: add rcu_barrier_sched() and rcu_barrier_bh() · 70f12f84
      Paul E. McKenney authored
      Add rcu_barrier_sched() and rcu_barrier_bh().  With these in place,
      rcutorture no longer gives the occasional oops when repeatedly starting
      and stopping torturing rcu_bh.  Also adds the API needed to flush out
      pre-existing call_rcu_sched() callbacks.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      70f12f84
    • Paul E. McKenney's avatar
      rcu: add memory barriers and comments to rcu_check_callbacks() · 8db559b8
      Paul E. McKenney authored
      Add comments to the logic that infers quiescent states when interrupting
      from either user mode or the idle loop.  Also add a memory barrier: it
      appears that James Huang was in fact onto something, as the scheduler
      is much less synchronization happy than it once was, so we can no longer
      rely on its memory barriers in all cases.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Reported-by: default avatarJames Huang <jamesclhuang@yahoo.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      8db559b8
    • Paul E. McKenney's avatar
      rcu: add call_rcu_sched() · 4446a36f
      Paul E. McKenney authored
      Fourth cut of patch to provide the call_rcu_sched().  This is again to
      synchronize_sched() as call_rcu() is to synchronize_rcu().
      
      Should be fine for experimental and -rt use, but not ready for inclusion.
      With some luck, I will be able to tell Andrew to come out of hiding on
      the next round.
      
      Passes multi-day rcutorture sessions with concurrent CPU hotplugging.
      
      Fixes since the first version include a bug that could result in
      indefinite blocking (spotted by Gautham Shenoy), better resiliency
      against CPU-hotplug operations, and other minor fixes.
      
      Fixes since the second version include reworking grace-period detection
      to avoid deadlocks that could happen when running concurrently with
      CPU hotplug, adding Mathieu's fix to avoid the softlockup messages,
      as well as Mathieu's fix to allow use earlier in boot.
      
      Fixes since the third version include a wrong-CPU bug spotted by
      Andrew, getting rid of the obsolete synchronize_kernel API that somehow
      snuck back in, merging spin_unlock() and local_irq_restore() in a
      few places, commenting the code that checks for quiescent states based
      on interrupting from user-mode execution or the idle loop, removing
      some inline attributes, and some code-style changes.
      
      Known/suspected shortcomings:
      
      o	I still do not entirely trust the sleep/wakeup logic.  Next step
      	will be to use a private snapshot of the CPU online mask in
      	rcu_sched_grace_period() -- if the CPU wasn't there at the start
      	of the grace period, we don't need to hear from it.  And the
      	bit about accounting for changes in online CPUs inside of
      	rcu_sched_grace_period() is ugly anyway.
      
      o	It might be good for rcu_sched_grace_period() to invoke
      	resched_cpu() when a given CPU wasn't responding quickly,
      	but resched_cpu() is declared static...
      
      This patch also fixes a long-standing bug in the earlier preemptable-RCU
      implementation of synchronize_rcu() that could result in loss of
      concurrent external changes to a task's CPU affinity mask.  I still cannot
      remember who reported this...
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      4446a36f
    • Steven Rostedt's avatar
      rcupreempt: remove duplicate prototypes · 8b09dee6
      Steven Rostedt authored
      rcu_batches_completed and rcu_patches_completed_bh are both declared
      in rcuclassic.h and rcupreempt.h. This patch removes the extra
      prototypes for them from rcupdate.h.
      
      rcu_batches_completed_bh is defined as a static inline in the rcupreempt.h
      header file. Trying to export this as EXPORT_SYMBOL_GPL causes linking problems
      with the powerpc linker. There's no need to export a static inlined function.
      
      Modules must be compiled with the same type of RCU implementation as the
      kernel they are for.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      8b09dee6
  2. 18 May, 2008 28 commits
  3. 17 May, 2008 3 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm · 29e92f48
      Linus Torvalds authored
      * 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm:
        [ARM] pxa: spitz wants PXA27x UDC definitions
        [ARM] pxa: fix pxafb build when cpufreq is enabled
        [ARM] fix parenthesis in include/asm-arm/arch-omap/control.h
        [ARM] colibri: fix support for DM9000 ethernet device
        [ARM] arm/kernel/arthur.c: add MODULE_LICENSE
        [ARM] 5037/1: Orion: fix DNS323/Kurobox Pro PCI initialisation
        [ARM] 5034/1: fix arm{925,926,940,946} dma_flush_range() in WT mode
        [ARM] export copy_page
        [ARM] 5026/1: locomo: add .settype for gpio and several small fixes
        ARM: OMAP: Fixed comments on global PRM register usage
        ARM: OMAP: Add PARENT_CONTROLS_CLOCK flag to dpll5_m2_ck
        ARM: OMAP: PRCM fixes to ssi clock handling
        ARM: OMAP: Add fuctional clock enabler for iva2
        ARM: OMAP: Fix 34xx to use correct shift values for gpio2-6 fclks
        ARM: OMAP: Keymap fix for palmte and palmz71
        ARM: OMAP: Fix Unbalanced enable for IRQ in omap mailbox
        ARM: OMAP: DMA: Fix incorrect channel linking
        ARM: OMAP: Warn on disabling clocks with no users
        ARM: OMAP: Add calls to omap2_set_globals_*()
        ARM: OMAP: Update MMC header to fix compile
      29e92f48
    • Russell King's avatar
    • Russell King's avatar
      Merge branch 'sa1100' · 1da78078
      Russell King authored
      1da78078