1. 18 7月, 2015 7 次提交
    • P
      rcu: Get rid of synchronize_sched_expedited()'s polling loop · 385b73c0
      Paul E. McKenney 提交于
      This commit gets rid of synchronize_sched_expedited()'s mutex_trylock()
      polling loop in favor of a funnel-locking scheme based on the rcu_node
      tree.  The work-done check is done at each level of the tree, allowing
      high-contention situations to be resolved quickly with reasonable levels
      of mutex contention.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      385b73c0
    • P
      rcu: Rework synchronize_sched_expedited() counter handling · d6ada2cf
      Paul E. McKenney 提交于
      Now that synchronize_sched_expedited() have a mutex, it can use simpler
      work-already-done detection scheme.  This commit simplifies this scheme
      by using something similar to the sequence-locking counter scheme.
      A counter is incremented before and after each grace period, so that
      the counter is odd in the midst of the grace period and even otherwise.
      So if the counter has advanced to the second even number that is
      greater than or equal to the snapshot, the required grace period has
      already happened.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      d6ada2cf
    • P
      rcu: Switch synchronize_sched_expedited() to stop_one_cpu() · c190c3b1
      Peter Zijlstra 提交于
      The synchronize_sched_expedited() currently invokes try_stop_cpus(),
      which schedules the stopper kthreads on each online non-idle CPU,
      and waits until all those kthreads are running before letting any
      of them stop.  This is disastrous for real-time workloads, which
      get hit with a preemption that is as long as the longest scheduling
      latency on any CPU, including any non-realtime housekeeping CPUs.
      This commit therefore switches to using stop_one_cpu() on each CPU
      in turn.  This avoids inflicting the worst-case scheduling latency
      on the worst-case CPU onto all other CPUs, and also simplifies the
      code a little bit.
      
      Follow-up commits will simplify the counter-snapshotting algorithm
      and convert a number of the counters that are now protected by the
      new ->expedited_mutex to non-atomic.
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      [ paulmck: Kept stop_one_cpu(), dropped disabling of "guardrails". ]
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      c190c3b1
    • P
      rcu: Remove CONFIG_RCU_CPU_STALL_INFO · 75c27f11
      Paul E. McKenney 提交于
      The CONFIG_RCU_CPU_STALL_INFO has been default-y for a couple of
      releases with no complaints, so it is time to eliminate this Kconfig
      option entirely, so that the long-form RCU CPU stall warnings cannot
      be disabled.  This commit does just that.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      75c27f11
    • P
      rcu: Stop disabling CPU hotplug in synchronize_rcu_expedited() · 9b683874
      Paul E. McKenney 提交于
      The fact that tasks could be migrated from leaf to root rcu_node
      structures meant that synchronize_rcu_expedited() had to disable
      CPU hotplug.  However, tasks now stay put, so this commit removes the
      CPU-hotplug disabling from synchronize_rcu_expedited().
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      9b683874
    • P
      rcu: Reset rcu_fanout_leaf if out of bounds · 13bd6494
      Paul E. McKenney 提交于
      Currently if the rcu_fanout_leaf boot parameter is out of bounds (that
      is, less than RCU_FANOUT_LEAF or greater than the number of bits in an
      unsigned long), a warning is issued and execution continues with the
      out-of-bounds value.  This can result in all manner of failures, so this
      patch resets rcu_fanout_leaf to RCU_FANOUT_LEAF when an out-of-bounds
      condition is detected.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      13bd6494
    • A
      rcu: Shut up bogus gcc array bounds warning · 032dfc87
      Alexander Gordeev 提交于
      Because gcc does not realize a loop would not be entered ever
      (i.e. in case of rcu_num_lvls == 1):
      
        for (i = 1; i < rcu_num_lvls; i++)
      	  rsp->level[i] = rsp->level[i - 1] + levelcnt[i - 1];
      
      some compiler (pre- 5.x?) versions give a bogus warning:
      
        kernel/rcu/tree.c: In function ‘rcu_init_one.isra.55’:
        kernel/rcu/tree.c:4108:13: warning: array subscript is above array bounds [-Warray-bounds]
           rsp->level[i] = rsp->level[i - 1] + rsp->levelcnt[i - 1];
                     ^
      Fix that warning by adding an extra item to rcu_state::level[]
      array. Once the bogus warning is fixed in gcc and kernel drops
      support of older versions, the dummy item may be removed from
      the array.
      
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Suggested-by: N"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NAlexander Gordeev <agordeev@redhat.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      032dfc87
  2. 16 7月, 2015 10 次提交
  3. 19 6月, 2015 1 次提交
    • T
      timer: Reduce timer migration overhead if disabled · bc7a34b8
      Thomas Gleixner 提交于
      Eric reported that the timer_migration sysctl is not really nice
      performance wise as it needs to check at every timer insertion whether
      the feature is enabled or not. Further the check does not live in the
      timer code, so we have an extra function call which checks an extra
      cache line to figure out that it is disabled.
      
      We can do better and store that information in the per cpu (hr)timer
      bases. I pondered to use a static key, but that's a nightmare to
      update from the nohz code and the timer base cache line is hot anyway
      when we select a timer base.
      
      The old logic enabled the timer migration unconditionally if
      CONFIG_NO_HZ was set even if nohz was disabled on the kernel command
      line.
      
      With this modification, we start off with migration disabled. The user
      visible sysctl is still set to enabled. If the kernel switches to NOHZ
      migration is enabled, if the user did not disable it via the sysctl
      prior to the switch. If nohz=off is on the kernel command line,
      migration stays disabled no matter what.
      
      Before:
        47.76%  hog       [.] main
        14.84%  [kernel]  [k] _raw_spin_lock_irqsave
         9.55%  [kernel]  [k] _raw_spin_unlock_irqrestore
         6.71%  [kernel]  [k] mod_timer
         6.24%  [kernel]  [k] lock_timer_base.isra.38
         3.76%  [kernel]  [k] detach_if_pending
         3.71%  [kernel]  [k] del_timer
         2.50%  [kernel]  [k] internal_add_timer
         1.51%  [kernel]  [k] get_nohz_timer_target
         1.28%  [kernel]  [k] __internal_add_timer
         0.78%  [kernel]  [k] timerfn
         0.48%  [kernel]  [k] wake_up_nohz_cpu
      
      After:
        48.10%  hog       [.] main
        15.25%  [kernel]  [k] _raw_spin_lock_irqsave
         9.76%  [kernel]  [k] _raw_spin_unlock_irqrestore
         6.50%  [kernel]  [k] mod_timer
         6.44%  [kernel]  [k] lock_timer_base.isra.38
         3.87%  [kernel]  [k] detach_if_pending
         3.80%  [kernel]  [k] del_timer
         2.67%  [kernel]  [k] internal_add_timer
         1.33%  [kernel]  [k] __internal_add_timer
         0.73%  [kernel]  [k] timerfn
         0.54%  [kernel]  [k] wake_up_nohz_cpu
      Reported-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Joonwoo Park <joonwoop@codeaurora.org>
      Cc: Wenbo Wang <wenbo.wang@memblaze.com>
      Link: http://lkml.kernel.org/r/20150526224512.127050787@linutronix.deSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      bc7a34b8
  4. 28 5月, 2015 22 次提交