linux/arch/unicore32/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
..
asm-offsets.c unicore32 core architecture: generic elf and ksyms stuff 2011-03-17 09:19:05 +08:00
clock.c unicore32 io: redefine __REG(x) and re-use readl/writel funcs 2011-03-17 09:19:19 +08:00
cpu-ucv2.c unicore32 additional architecture files: pm related files 2011-03-17 09:19:11 +08:00
debug-macro.S unicore32 additional architecture files: low-level lib: ocd debug 2011-03-17 09:19:12 +08:00
debug.S unicore32 additional architecture files: low-level lib: ocd debug 2011-03-17 09:19:12 +08:00
dma.c unicore32 io: redefine __REG(x) and re-use readl/writel funcs 2011-03-17 09:19:19 +08:00
early_printk.c unicore32 additional architecture files: low-level lib: ocd debug 2011-03-17 09:19:12 +08:00
elf.c unicore32 core architecture: generic elf and ksyms stuff 2011-03-17 09:19:05 +08:00
entry.S unicore32: modify io_p2v and io_v2p macros, and adjust PKUNITY_mmio_BASEs 2011-03-17 09:19:21 +08:00
fpu-ucf64.c unicore32 additional architecture files: float point handling 2011-03-17 09:19:11 +08:00
gpio.c unicore32 io: redefine __REG(x) and re-use readl/writel funcs 2011-03-17 09:19:19 +08:00
head.S Fix common misspellings 2011-03-31 11:26:23 -03:00
hibernate.c unicore32 additional architecture files: pm related files 2011-03-17 09:19:11 +08:00
hibernate_asm.S unicore32 additional architecture files: pm related files 2011-03-17 09:19:11 +08:00
init_task.c unicore32 core architecture: process/thread related codes 2011-03-17 09:19:07 +08:00
irq.c PM / UNICORE32: Use struct syscore_ops instead of sysdevs for PM 2011-05-11 21:37:15 +02:00
ksyms.c unicore32: fix build error for find bitops 2011-11-15 17:13:14 +08:00
ksyms.h unicore32 core architecture: generic elf and ksyms stuff 2011-03-17 09:19:05 +08:00
Makefile unicore32: move rtc-puv3.c to drivers/rtc directory 2011-06-09 16:15:24 +08:00
module.c modules: make arch's use default loader hooks 2011-07-24 22:06:04 +09:30
pci.c PCI: Make the struct pci_dev * argument of pci_fixup_irqs const. 2011-07-22 08:26:06 -07:00
pm.c unicore32 additional architecture files: pm related files 2011-03-17 09:19:11 +08:00
process.c nohz: Separate out irq exit and idle loop dyntick logic 2011-12-11 10:31:35 -08:00
ptrace.c unicore32 additional architecture files: ptrace handling 2011-03-17 09:19:12 +08:00
puv3-core.c unicore32 framebuffer fix: get videomemory by __get_free_pages() and make it floatable 2011-04-02 16:17:38 +08:00
puv3-nb0916.c unicore32: modify io_p2v and io_v2p macros, and adjust PKUNITY_mmio_BASEs 2011-03-17 09:19:21 +08:00
pwm.c unicore32 core architecture: timer and time handling 2011-03-17 09:19:10 +08:00
setup.c unicore32 framebuffer fix: get videomemory by __get_free_pages() and make it floatable 2011-04-02 16:17:38 +08:00
setup.h unicore32 core architecture: low level entry and setup codes 2011-03-17 09:19:06 +08:00
signal.c unicore32 core architecture: signals handling 2011-03-17 09:19:10 +08:00
sleep.S unicore32: modify io_p2v and io_v2p macros, and adjust PKUNITY_mmio_BASEs 2011-03-17 09:19:21 +08:00
stacktrace.c unicore32 core architecture: process/thread related codes 2011-03-17 09:19:07 +08:00
sys.c unicore32 core architecture: processor and system headers 2011-03-17 09:19:06 +08:00
time.c unicore32 io: redefine __REG(x) and re-use readl/writel funcs 2011-03-17 09:19:19 +08:00
traps.c sysfs: remove "last sysfs file:" line from the oops messages 2011-05-13 16:05:51 -07:00
vmlinux.lds.S unicore32: change PERCPU to PERCPU_SECTION 2011-06-09 16:27:46 +08:00