1. 26 Apr, 2012 1 commit
  2. 25 Apr, 2012 7 commits
    • Paul E. McKenney's avatar
      rcu: Document why rcu_blocking_is_gp() is safe · 6d813391
      Paul E. McKenney authored
      The rcu_blocking_is_gp() function tests to see if there is only one
      online CPU, and if so, synchronize_sched() and friends become no-ops.
      However, for larger systems, num_online_cpus() scans a large vector,
      and might be preempted while doing so.  While preempted, any number
      of CPUs might come online and go offline, potentially resulting in
      num_online_cpus() returning 1 when there never had only been one
      CPU online.  This could result in a too-short RCU grace period, which
      could in turn result in total failure, except that the only way that
      the grace period is too short is if there is an RCU read-side critical
      section spanning it.  For RCU-sched and RCU-bh (which are the only
      cases using rcu_blocking_is_gp()), RCU read-side critical sections
      have either preemption or bh disabled, which prevents CPUs from going
      offline.  This in turn prevents actual failures from occurring.
      
      This commit therefore adds a large block comment to rcu_blocking_is_gp()
      documenting why it is safe.  This commit also moves rcu_blocking_is_gp()
      into kernel/rcutree.c, which should help prevent unwary developers from
      mistaking it for a generally useful function.
      Signed-off-by: default avatarPaul E. McKenney <paul.mckenney@linaro.org>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      6d813391
    • Paul E. McKenney's avatar
      rcu: Document kernel command-line parameters · dabb8aa9
      Paul E. McKenney authored
      Bring RCU's kernel command-line parameter documentation up to date.
      Signed-off-by: default avatarPaul E. McKenney <paul.mckenney@linaro.org>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      dabb8aa9
    • Paul E. McKenney's avatar
      rcu: Reduce cache-miss initialization latencies for large systems · 8932a63d
      Paul E. McKenney authored
      Commit #0209f649 (rcu: limit rcu_node leaf-level fanout) set an upper
      limit of 16 on the leaf-level fanout for the rcu_node tree.  This was
      needed to reduce lock contention that was induced by the synchronization
      of scheduling-clock interrupts, which was in turn needed to improve
      energy efficiency for moderate-sized lightly loaded servers.
      
      However, reducing the leaf-level fanout means that there are more
      leaf-level rcu_node structures in the tree, which in turn means that
      RCU's grace-period initialization incurs more cache misses.  This is
      not a problem on moderate-sized servers with only a few tens of CPUs,
      but becomes a major source of real-time latency spikes on systems with
      many hundreds of CPUs.  In addition, the workloads running on these large
      systems tend to be CPU-bound, which eliminates the energy-efficiency
      advantages of synchronizing scheduling-clock interrupts.  Therefore,
      these systems need maximal values for the rcu_node leaf-level fanout.
      
      This commit addresses this problem by introducing a new kernel parameter
      named RCU_FANOUT_LEAF that directly controls the leaf-level fanout.
      This parameter defaults to 16 to handle the common case of a moderate
      sized lightly loaded servers, but may be set higher on larger systems.
      Reported-by: default avatarMike Galbraith <efault@gmx.de>
      Reported-by: default avatarDimitri Sivanich <sivanich@sgi.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      8932a63d
    • Jan Engelhardt's avatar
      rcu: Make __kfree_rcu() less dependent on compiler choices · d8169d4c
      Jan Engelhardt authored
      Currently, __kfree_rcu() is implemented as an inline function, and
      contains a BUILD_BUG_ON() that malfunctions if __kfree_rcu() is compiled
      as an out-of-line function.  Unfortunately, there are compiler settings
      (e.g., -O0) that can result in __kfree_rcu() being compiled out of line,
      resulting in annoying build breakage.  This commit therefore converts
      both __kfree_rcu() and __is_kfree_rcu_offset() from inline functions to
      macros to prevent such misbehavior on the part of the compiler.
      Signed-off-by: default avatarJan Engelhardt <jengelh@medozas.de>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
      d8169d4c
    • Paul E. McKenney's avatar
      rcu: Clarify help text for RCU_BOOST_PRIO · c9336643
      Paul E. McKenney authored
      The old text confused real-time applications with real-time threads, so
      that you pretty much needed to understand how this kernel configuration
      parameter worked to understand the help text.  This commit therefore
      attempts to make the help text human-readable.
      Reported-by: default avatarJörn Engel <joern@purestorage.com>
      Signed-off-by: default avatarPaul E. McKenney <paul.mckenney@linaro.org>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      c9336643
    • Michel Machado's avatar
      rcu: Replace list_first_entry_rcu() with list_first_or_null_rcu() · f88022a4
      Michel Machado authored
      The list_first_entry_rcu() macro is inherently unsafe because it cannot
      be applied to an empty list.  But because RCU readers do not exclude
      updaters, a list might become empty between the time that list_empty()
      claimed it was non-empty and the time that list_first_entry_rcu() is
      invoked.  Therefore, the list_empty() test cannot be separated from the
      list_first_entry_rcu() call.  This commit therefore combines these to
      macros to create a new list_first_or_null_rcu() macro that replaces
      the old (and unsafe) list_first_entry_rcu() macro.
      
      This patch incorporates Paul's review comments on the previous version of
      this patch available here:
      
      https://lkml.org/lkml/2012/4/2/536
      
      This patch cannot break any upstream code because list_first_entry_rcu()
      is not being used anywhere in the kernel (tested with grep(1)), and any
      external code using it is probably broken as a result of using it.
      Signed-off-by: default avatarMichel Machado <michel@digirati.com.br>
      CC: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      CC: Dipankar Sarma <dipankar@in.ibm.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      f88022a4
    • Dave Jones's avatar
      rcu: List-debug variants of rcu list routines. · 559f9bad
      Dave Jones authored
      * Make __list_add_rcu check the next->prev and prev->next pointers
        just like __list_add does.
      * Make list_del_rcu use __list_del_entry, which does the same checking
        at deletion time.
      
      Has been running for a week here without anything being tripped up,
      but it seems worth adding for completeness just in case something
      ever does corrupt those lists.
      Signed-off-by: default avatarDave Jones <davej@redhat.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      559f9bad
  3. 21 Apr, 2012 23 commits
  4. 20 Apr, 2012 9 commits