android_kernel_google_msm/include
Paul E. McKenney 10dd2ef4aa rcu: Precompute RCU_FAST_NO_HZ timer offsets
When a CPU is entering dyntick-idle mode, tick_nohz_stop_sched_tick()
calls rcu_needs_cpu() see if RCU needs that CPU, and, if not, computes the
next wakeup time based on the timer wheels.  Only later, when actually
entering the idle loop, rcu_prepare_for_idle() will be invoked.  In some
cases, rcu_prepare_for_idle() will post timers to wake the CPU back up.
But all for naught: The next wakeup time for the CPU has already been
computed, and posting a timer afterwards does not force that wakeup
time to be recomputed.  This means that rcu_prepare_for_idle()'s have
no effect.

This is not a problem on a busy system because something else will wake
up the CPU soon enough.  However, on lightly loaded systems, the CPU
might stay asleep for a considerable length of time.  If that CPU has
a callback that the rest of the system is waiting on, the system might
run very slowly or (in theory) even hang.

This commit avoids this problem by having rcu_needs_cpu() give
tick_nohz_stop_sched_tick() an estimate of when RCU will need the CPU
to wake back up, which tick_nohz_stop_sched_tick() takes into account
when programming the CPU's wakeup time.  An alternative approach is
for rcu_prepare_for_idle() to use hrtimers instead of normal timers,
but timers are much more efficient than are hrtimers for frequently
and repeatedly posting and cancelling a given timer, which is exactly
what RCU_FAST_NO_HZ does.

CRs-fixed: 657837
Change-Id: I45c9163678240ca0b6fcac06b025d4cdb140907c
Reported-by: Pascal Chapperon <pascal.chapperon@wanadoo.fr>
Reported-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Tested-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Tested-by: Pascal Chapperon <pascal.chapperon@wanadoo.fr>
Git-commit: aa9b16306e
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Ramesh Gupta Guntha <rggupt@codeaurora.org>
2016-10-29 23:12:18 +08:00
..
acpi
asm-generic crypto: create generic version of ablk_helper 2016-10-29 23:12:13 +08:00
crypto crypto: sha512 - Expose generic sha512 routine to be callable from other modules 2016-10-29 23:12:14 +08:00
drm msm: kgsl: Add genlock to KGSL DRM driver 2013-09-11 22:41:12 -07:00
keys KEYS: Permit in-place link replacement in keyring list 2016-10-29 23:12:12 +08:00
linux rcu: Precompute RCU_FAST_NO_HZ timer offsets 2016-10-29 23:12:18 +08:00
math-emu
media Fix header list when building with Android 2016-10-29 23:12:09 +08:00
misc
mtd
net net: add validation for the socket syscall protocol argument 2016-10-29 23:12:11 +08:00
pcmcia
rdma
rxrpc
scsi
sound ASoC: add definations for compressed operations 2013-04-18 16:08:45 -07:00
target
trace rcu: Update RCU_FAST_NO_HZ tracing for lazy callbacks 2016-10-29 23:12:18 +08:00
video
xen
Kbuild