linux-stable/arch/blackfin/kernel
Frederic Weisbecker 280f06774a nohz: Separate out irq exit and idle loop dyntick logic
The tick_nohz_stop_sched_tick() function, which tries to delay
the next timer tick as long as possible, can be called from two
places:

- From the idle loop to start the dytick idle mode
- From interrupt exit if we have interrupted the dyntick
idle mode, so that we reprogram the next tick event in
case the irq changed some internal state that requires this
action.

There are only few minor differences between both that
are handled by that function, driven by the ts->inidle
cpu variable and the inidle parameter. The whole guarantees
that we only update the dyntick mode on irq exit if we actually
interrupted the dyntick idle mode, and that we enter in RCU extended
quiescent state from idle loop entry only.

Split this function into:

- tick_nohz_idle_enter(), which sets ts->inidle to 1, enters
dynticks idle mode unconditionally if it can, and enters into RCU
extended quiescent state.

- tick_nohz_irq_exit() which only updates the dynticks idle mode
when ts->inidle is set (ie: if tick_nohz_idle_enter() has been called).

To maintain symmetry, tick_nohz_restart_sched_tick() has been renamed
into tick_nohz_idle_exit().

This simplifies the code and micro-optimize the irq exit path (no need
for local_irq_save there). This also prepares for the split between
dynticks and rcu extended quiescent state logics. We'll need this split to
further fix illegal uses of RCU in extended quiescent states in the idle
loop.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: David Miller <davem@davemloft.net>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2011-12-11 10:31:35 -08:00
..
cplb-mpu Blackfin: Rename IRQ flags handling functions 2010-10-07 14:08:52 +01:00
cplb-nompu Blackfin: no-mpu: fix masking of small uncached dma region 2011-01-10 07:18:18 -05:00
.gitignore
asm-offsets.c Blackfin: optimize double fault boot checking 2011-07-23 01:10:43 -04:00
bfin_dma_5xx.c Blackfin: work around anomaly 05000480 2011-05-25 08:24:14 -04:00
bfin_gpio.c Blackfin: bf54x: fix GPIO resume code 2011-07-23 01:18:32 -04:00
bfin_ksyms.c Blackfin: move internal irq prototypes out of global namespace 2011-05-25 08:13:43 -04:00
cplbinfo.c
debug-mmrs.c Blackfin: debug-mmrs: generalize pint logic 2011-07-23 01:18:26 -04:00
dma-mapping.c blackfin: Add export.h to files using EXPORT_SYMBOL/THIS_MODULE 2011-10-31 19:31:01 -04:00
dumpstack.c Blackfin: make hardware trace output a little more useful 2010-05-21 09:40:19 -04:00
early_printk.c
entry.S Blackfin: initial XIP support 2010-03-09 00:30:48 -05:00
exception.c Blackfin: split kernel/traps.c 2010-05-21 09:40:17 -04:00
fixed_code.S
flat.c
ftrace-entry.S Blackfin: add support for dynamic ftrace 2010-08-06 12:55:54 -04:00
ftrace.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
gptimers.c Blackfin: gptimers: use bfin read/write helpers 2011-07-23 01:18:21 -04:00
init_task.c Blackfin: fix the section name of init_thread_union 2010-03-09 00:30:48 -05:00
ipipe.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
irqchip.c Blackfin: move internal irq prototypes out of global namespace 2011-05-25 08:13:43 -04:00
kgdb.c Fix common misspellings 2011-03-31 11:26:23 -03:00
kgdb_test.c Blackfin: kgdb_test: rework code to avoid -O0 usage 2011-10-25 19:51:38 -04:00
Makefile Blackfin: kgdb_test: rework code to avoid -O0 usage 2011-10-25 19:51:38 -04:00
module.c modules: make arch's use default loader hooks 2011-07-24 22:06:04 +09:30
nmi.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
perf_event.c blackfin: Add export.h to files using EXPORT_SYMBOL/THIS_MODULE 2011-10-31 19:31:01 -04:00
process.c nohz: Separate out irq exit and idle loop dyntick logic 2011-12-11 10:31:35 -08:00
pseudodbg.c Blackfin: show the whole accumulator in the pseudo DBG insn 2010-05-22 14:19:06 -04:00
ptrace.c ptrace: cleanup arch_ptrace() and friends on Blackfin 2010-10-27 18:03:10 -07:00
pwm.c Blackfin: pwm: implement linux/pwm.h API 2011-07-23 01:18:23 -04:00
reboot.c Blackfin: bf526: restrict reboot workaround to 0.0 silicon 2011-07-23 01:18:33 -04:00
setup.c Blackfin: optimize double fault boot checking 2011-07-23 01:10:43 -04:00
shadow_console.c
signal.c Blackfin: add support for restart_syscall() 2010-03-09 00:30:51 -05:00
stacktrace.c
sys_bfin.c blackfin: Add export.h to files using EXPORT_SYMBOL/THIS_MODULE 2011-10-31 19:31:01 -04:00
time-ts.c Blackfin: irq: remove IRQF_DISABLED 2011-10-26 04:22:26 -04:00
time.c Blackfin: irq: remove IRQF_DISABLED 2011-10-26 04:22:26 -04:00
trace.c bfin: Use proper accessors in trace 2011-03-29 14:47:59 +02:00
traps.c Fix common misspellings 2011-03-31 11:26:23 -03:00
vmlinux.lds.S Blackfin: make sure percpu section is aligned in XIP builds 2011-07-23 01:18:22 -04:00