android_kernel_motorola_sm6225/arch/mips/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
..
cpufreq MIPS: errloongson2_clock: Fix build error by including linux/module.h 2011-11-10 17:59:45 +00:00
.gitignore [MIPS] Ignore vmlinux.lds generated files 2008-08-26 09:10:27 +01:00
8250-platform.c mips: remove needless include of module.h from core kernel files. 2011-10-31 19:30:57 -04:00
asm-offsets.c MIPS: Remove unused task_struct.trap_no field. 2010-08-05 13:26:30 +01:00
binfmt_elfn32.c remove div_long_long_rem 2008-05-01 08:03:58 -07:00
binfmt_elfo32.c MIPS: 64-bit: Fix o32 core dump 2009-07-03 15:45:27 +01:00
branch.c MIPS: Sanitize restart logics 2010-10-18 16:59:02 +01:00
cevt-bcm1480.c MIPS: Add missing #inclusions of <linux/irq.h> 2010-10-07 14:08:54 +01:00
cevt-ds1287.c MIPS: Add missing #inclusions of <linux/irq.h> 2010-10-07 14:08:54 +01:00
cevt-gt641xx.c MIPS: Add missing #inclusions of <linux/irq.h> 2010-10-07 14:08:54 +01:00
cevt-r4k.c MIPS: Kernel hangs occasionally during boot. 2011-11-08 17:59:22 +00:00
cevt-sb1250.c MIPS: Add missing #inclusions of <linux/irq.h> 2010-10-07 14:08:54 +01:00
cevt-smtc.c MIPS: Add missing #inclusions of <linux/irq.h> 2010-10-07 14:08:54 +01:00
cevt-txx9.c mips: convert to clocksource_register_hz/khz 2011-02-21 13:33:50 -08:00
cpu-bugs64.c Fix common misspellings 2011-03-31 11:26:23 -03:00
cpu-probe.c Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux 2011-11-06 19:44:47 -08:00
csrc-bcm1480.c mips: convert to clocksource_register_hz/khz 2011-02-21 13:33:50 -08:00
csrc-ioasic.c mips: convert to clocksource_register_hz/khz 2011-02-21 13:33:50 -08:00
csrc-powertv.c mips: convert to clocksource_register_hz/khz 2011-02-21 13:33:50 -08:00
csrc-r4k.c mips: convert to clocksource_register_hz/khz 2011-02-21 13:33:50 -08:00
csrc-sb1250.c mips: convert to clocksource_register_hz/khz 2011-02-21 13:33:50 -08:00
early_printk.c [MIPS] fix sparse warning about setup_early_printk() 2008-07-15 18:44:29 +01:00
entry.S MIPS: Split do_syscall_trace into two functions. 2011-05-19 09:55:44 +01:00
ftrace.c MIPS: Ftrace: Fix the CONFIG_DYNAMIC_FTRACE=n compile 2011-09-21 17:52:04 +02:00
genex.S MIPS: Read watch registers with interrupts disabled. 2009-01-30 21:32:58 +00:00
gpio_txx9.c [MIPS] txx9: Make gpio_txx9 entirely spinlock-safe 2008-07-15 18:44:34 +01:00
head.S MIPS: Avoid potential hazard on Context register 2009-11-02 12:00:07 +01:00
i8253.c mips: migrate core kernel file from module.h --> export.h 2011-10-31 19:30:56 -04:00
i8259.c MIPS: i8259: Mark cascade interrupt non-threaded 2011-09-21 17:52:28 +02:00
init_task.c mips: migrate core kernel file from module.h --> export.h 2011-10-31 19:30:56 -04:00
irq-gic.c MIPS: Convert the irq functions to the new names 2011-03-29 14:48:07 +02:00
irq-gt641xx.c MIPS: Convert the irq functions to the new names 2011-03-29 14:48:07 +02:00
irq-msc01.c mips: remove needless include of module.h from core kernel files. 2011-10-31 19:30:57 -04:00
irq-rm7000.c MIPS: Convert the irq functions to the new names 2011-03-29 14:48:07 +02:00
irq-rm9000.c MIPS: Convert the irq functions to the new names 2011-03-29 14:48:07 +02:00
irq.c mips: remove needless include of module.h from core kernel files. 2011-10-31 19:30:57 -04:00
irq_cpu.c MIPS: Install handlers for software IRQs 2011-07-25 17:26:54 +01:00
irq_txx9.c MIPS: Convert the irq functions to the new names 2011-03-29 14:48:07 +02:00
jump_label.c MIPS: jump label: Add MIPS support. 2011-01-18 19:30:24 +01:00
kgdb.c MIPS: Fix a typo. 2010-10-04 18:33:54 +01:00
kprobes.c MIPS: kprobe: Add support. 2010-08-05 13:26:29 +01:00
kspd.c MIPS: kspd: Adjust confusing if indentation 2010-10-04 18:33:54 +01:00
linux32.c MIPS: Compat: Use 32-bit wrapper for compat_sys_futex. 2011-09-21 17:53:44 +02:00
machine_kexec.c [MIPS] Unconditionally writeback and invalidate caches on kexec. 2007-08-27 02:16:59 +01:00
Makefile MIPS: perf: Reorganize contents of perf support files. 2011-10-24 23:34:26 +01:00
mcount.S MIPS: tracing: Fix the indentation of mcount.S 2010-08-05 13:26:06 +01:00
mips-mt-fpaff.c MIPS: MT: Fix build error iFPU affinity code 2010-10-25 08:12:27 -07:00
mips-mt.c mips: migrate core kernel file from module.h --> export.h 2011-10-31 19:30:56 -04:00
mips_ksyms.c mips: migrate core kernel file from module.h --> export.h 2011-10-31 19:30:56 -04:00
mips_machine.c MIPS: Add generic support for multiple machines within a single kernel 2011-01-18 19:30:21 +01:00
module.c mips: remove needless include of module.h from core kernel files. 2011-10-31 19:30:57 -04:00
octeon_switch.S update David Miller's old email address 2011-04-06 06:19:38 -07:00
perf_event.c MIPS: perf: Reorganize contents of perf support files. 2011-10-24 23:34:26 +01:00
perf_event_mipsxx.c perf: Don't use -ENOSPC for out of PMU resources 2011-11-14 13:01:24 +01:00
proc.c MIPS: Probe for presence of KScratch registers. 2011-01-18 19:30:22 +01:00
process.c nohz: Separate out irq exit and idle loop dyntick logic 2011-12-11 10:31:35 -08:00
prom.c mips: migrate core kernel file from module.h --> export.h 2011-10-31 19:30:56 -04:00
ptrace.c MIPS: Split do_syscall_trace into two functions. 2011-05-19 09:55:44 +01:00
ptrace32.c headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00
r4k_fpu.S update David Miller's old email address 2011-04-06 06:19:38 -07:00
r4k_switch.S update David Miller's old email address 2011-04-06 06:19:38 -07:00
r2300_fpu.S update David Miller's old email address 2011-04-06 06:19:38 -07:00
r2300_switch.S update David Miller's old email address 2011-04-06 06:19:38 -07:00
r6000_fpu.S update David Miller's old email address 2011-04-06 06:19:38 -07:00
relocate_kernel.S [MIPS] Kexec: Fix several 64-bit bugs. 2007-07-31 21:35:36 +01:00
reset.c mips: migrate core kernel file from module.h --> export.h 2011-10-31 19:30:56 -04:00
rtlx.c mips: remove needless include of module.h from core kernel files. 2011-10-31 19:30:57 -04:00
scall32-o32.S MIPS: Hook up process_vm_readv and process_vm_writev system calls. 2011-11-09 00:07:56 +00:00
scall64-64.S MIPS: Hook up process_vm_readv and process_vm_writev system calls. 2011-11-09 00:07:56 +00:00
scall64-n32.S MIPS: Hook up process_vm_readv and process_vm_writev system calls. 2011-11-09 00:07:56 +00:00
scall64-o32.S MIPS: Hook up process_vm_readv and process_vm_writev system calls. 2011-11-09 00:07:56 +00:00
setup.c mips: migrate core kernel file from module.h --> export.h 2011-10-31 19:30:56 -04:00
signal-common.h MIPS: Move signal trampolines off of the stack. 2010-04-12 17:26:15 +01:00
signal.c MIPS: Handle __put_user() sleeping. 2011-09-21 17:52:38 +02:00
signal32.c MIPS: Fix GCC-4.6 'set but not used' warning in signal*.c 2011-03-14 21:07:25 +01:00
signal_n32.c MIPS: do_sigaltstack() expects userland pointers 2010-10-18 16:59:03 +01:00
smp-cmp.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
smp-mt.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
smp-up.c cpumask: arch_send_call_function_ipi_mask: mips 2009-09-24 09:34:45 +09:30
smp.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
smtc-asm.S [MIPS] SMTC: Don't set and restore irqregs ptr from self_ipi. 2007-06-11 18:20:53 +01:00
smtc-proc.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
smtc.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
spinlock_test.c mips: migrate core kernel file from module.h --> export.h 2011-10-31 19:30:56 -04:00
spram.c MIPS: SPRAM: Clean up support code a little 2009-11-02 12:00:05 +01:00
stacktrace.c mips: migrate core kernel file from module.h --> export.h 2011-10-31 19:30:56 -04:00
sync-r4k.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
syscall.c MIPS: Move arch_get_unmapped_area and gang to new file. 2011-05-19 09:55:49 +01:00
time.c mips: migrate core kernel file from module.h --> export.h 2011-10-31 19:30:56 -04:00
topology.c MIPS: Add arch generic CPU hotplug 2009-06-24 18:34:40 +01:00
traps.c MIPS: ASID conflict after CPU hotplug 2011-11-10 17:59:45 +00:00
unaligned.c mips: remove needless include of module.h from core kernel files. 2011-10-31 19:30:57 -04:00
vdso.c MIPS: Make init_vdso a subsys_initcall. 2010-07-26 19:08:16 +01:00
vmlinux.lds.S Merge branch 'for-2.6.40' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2011-05-24 11:53:42 -07:00
vpe.c mips: remove needless include of module.h from core kernel files. 2011-10-31 19:30:57 -04:00
watch.c MIPS: Add HARDWARE_WATCHPOINTS definitions and support code. 2008-10-11 16:18:56 +01:00