1
linux/arch/avr32/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
..
.gitignore avr32: add .gitignore files 2008-09-19 18:21:29 +02:00
asm-offsets.c avr32: Fix lockup after Java stack underflow in user mode 2008-09-01 13:04:04 +02:00
avr32_ksyms.c asm-generic: rename generic little-endian bitops functions 2011-03-23 19:46:11 -07:00
cpu.c
entry-avr32b.S KEYS: Extend TIF_NOTIFY_RESUME to (almost) all architectures [try #6] 2009-09-02 21:29:19 +10:00
head.S
init_task.c Use new __init_task_data macro in arch init_task.c files. 2009-09-21 06:27:08 +02:00
irq.c avr32: Use generic show_interrupts() 2011-03-24 20:35:56 +01:00
kprobes.c
Makefile
module.c modules: make arch's use default loader hooks 2011-07-24 22:06:04 +09:30
nmi_debug.c
ocd.c
process.c nohz: Separate out irq exit and idle loop dyntick logic 2011-12-11 10:31:35 -08:00
ptrace.c ptrace: cleanup arch_ptrace() on avr32 2010-10-27 18:03:10 -07:00
setup.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
signal.c KEYS: Add missing linux/tracehook.h #inclusions 2009-09-09 18:30:02 +10:00
stacktrace.c
switch_to.S
sys_avr32.c Make do_execve() take a const filename pointer 2010-08-17 18:07:43 -07:00
syscall_table.S All Arch: remove linkage for sys_nfsservctl system call 2011-08-26 15:09:58 -07:00
syscall-stubs.S Unify sys_mmap* 2009-12-11 06:44:29 -05:00
time.c avr32: Convert to clocksource_register_hz 2011-01-13 20:41:11 +01:00
traps.c avr32: init cannot ignore signals sent by force_sig_info() 2011-04-13 15:46:55 +02:00
vmlinux.lds.S avr32: clean up linker script using standard macros. 2009-10-06 17:39:22 +02:00