linux/arch/tile/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
backtrace.c arch/tile: factor out <arch/opcode.h> header 2011-11-03 16:58:54 -04:00
compat_signal.c arch/tile: support signal "exception-trace" hook 2011-05-19 22:55:59 -04:00
compat.c arch/tile: cleanups for tilegx compat mode 2011-05-19 22:56:13 -04:00
early_printk.c arch/tile: bomb raw_local_irq_ to arch_local_irq_ 2010-11-01 15:30:42 -04:00
entry.S arch/tile: use a cleaner technique to enable interrupt for cpu_idle() 2011-03-01 16:20:48 -05:00
futex_64.S arch/tile: finish enabling support for TILE-Gx 64-bit chip 2011-05-12 15:52:12 -04:00
hardwall.c arch/tile: more /proc and /sys file support 2011-05-27 10:39:05 -04:00
head_32.S arch/tile: support newer binutils assembler shift semantics 2011-03-17 14:32:06 -04:00
head_64.S arch/tile: finish enabling support for TILE-Gx 64-bit chip 2011-05-12 15:52:12 -04:00
hvglue.lds arch/tile: Enable more sophisticated IRQ model for 32-bit chips. 2010-07-06 13:34:01 -04:00
init_task.c
intvec_32.S tile: revert change from <asm/atomic.h> to <linux/atomic.h> in asm files 2011-10-13 08:25:01 -04:00
intvec_64.S arch/tile: finish enabling support for TILE-Gx 64-bit chip 2011-05-12 15:52:12 -04:00
irq.c arch/tile: use new generic {enable,disable}_percpu_irq() routines 2011-12-03 15:31:49 -05:00
machine_kexec.c arch/tile: support 4KB page size as well as 64KB 2011-03-10 13:17:53 -05:00
Makefile arch/tile: more /proc and /sys file support 2011-05-27 10:39:05 -04:00
messaging.c arch/tile: bomb raw_local_irq_ to arch_local_irq_ 2010-11-01 15:30:42 -04:00
module.c arch/tile: factor out <arch/opcode.h> header 2011-11-03 16:58:54 -04:00
pci-dma.c arch/tile: add a few #includes and an EXPORT to catch up with kernel changes. 2011-12-03 15:31:41 -05:00
pci.c arch/tile: add a few #includes and an EXPORT to catch up with kernel changes. 2011-12-03 15:31:41 -05:00
proc.c arch/tile: more /proc and /sys file support 2011-05-27 10:39:05 -04:00
process.c nohz: Separate out irq exit and idle loop dyntick logic 2011-12-11 10:31:35 -08:00
ptrace.c arch/tile: don't allow user code to set the PL via ptrace or signal return 2010-11-01 15:31:17 -04:00
reboot.c arch/tile: bomb raw_local_irq_ to arch_local_irq_ 2010-11-01 15:30:42 -04:00
regs_32.S arch/tile: parameterize system PLs to support KVM port 2010-10-15 15:38:09 -04:00
regs_64.S arch/tile: finish enabling support for TILE-Gx 64-bit chip 2011-05-12 15:52:12 -04:00
relocate_kernel.S
setup.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
signal.c arch/tile: support signal "exception-trace" hook 2011-05-19 22:55:59 -04:00
single_step.c arch/tile: factor out <arch/opcode.h> header 2011-11-03 16:58:54 -04:00
smp.c sched: Provide scheduler_ipi() callback in response to smp_send_reschedule() 2011-04-14 08:52:32 +02:00
smpboot.c BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
stack.c arch/tile: refactor backtracing code 2011-05-02 13:49:14 -04:00
sys.c arch/tile: cleanups for tilegx compat mode 2011-05-19 22:56:13 -04:00
sysfs.c arch/tile: add a few #includes and an EXPORT to catch up with kernel changes. 2011-12-03 15:31:41 -05:00
tile-desc_32.c arch/tile: factor out <arch/opcode.h> header 2011-11-03 16:58:54 -04:00
tile-desc_64.c arch/tile: factor out <arch/opcode.h> header 2011-11-03 16:58:54 -04:00
time.c clocksource: tile: convert to use clocksource_register_hz 2011-06-03 17:26:21 -04:00
tlb.c tile: replace mm->cpu_vm_mask with mm_cpumask() 2011-05-04 14:41:44 -04:00
traps.c arch/tile: factor out <arch/opcode.h> header 2011-11-03 16:58:54 -04:00
vmlinux.lds.S percpu: Always align percpu output section to PAGE_SIZE 2011-03-24 18:50:09 +01:00