Srivatsa S. Bhat
b47430d3ad
rcu/idle: Wrap cpu-idle poll mode within rcu_idle_enter/exit
...
Bjørn Mork reported the following warning when running powertop.
[ 49.289034] ------------[ cut here ]------------
[ 49.289055] WARNING: at kernel/rcutree.c:502 rcu_eqs_exit_common.isra.48+0x3d/0x125()
[ 49.289244] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.10.0-bisect-rcu-warn+ #107
[ 49.289251] ffffffff8157d8c8 ffffffff81801e28 ffffffff8137e4e3 ffffffff81801e68
[ 49.289260] ffffffff8103094f ffffffff81801e68 0000000000000000 ffff88023afcd9b0
[ 49.289268] 0000000000000000 0140000000000000 ffff88023bee7700 ffffffff81801e78
[ 49.289276] Call Trace:
[ 49.289285] [<ffffffff8137e4e3>] dump_stack+0x19/0x1b
[ 49.289293] [<ffffffff8103094f>] warn_slowpath_common+0x62/0x7b
[ 49.289300] [<ffffffff8103097d>] warn_slowpath_null+0x15/0x17
[ 49.289306] [<ffffffff810a9006>] rcu_eqs_exit_common.isra.48+0x3d/0x125
[ 49.289314] [<ffffffff81079b49>] ? trace_hardirqs_off_caller+0x37/0xa6
[ 49.289320] [<ffffffff810a9692>] rcu_idle_exit+0x85/0xa8
[ 49.289327] [<ffffffff8107076e>] trace_cpu_idle_rcuidle+0xae/0xff
[ 49.289334] [<ffffffff810708b1>] cpu_startup_entry+0x72/0x115
[ 49.289341] [<ffffffff813689e5>] rest_init+0x149/0x150
[ 49.289347] [<ffffffff8136889c>] ? csum_partial_copy_generic+0x16c/0x16c
[ 49.289355] [<ffffffff81a82d34>] start_kernel+0x3f0/0x3fd
[ 49.289362] [<ffffffff81a8274c>] ? repair_env_string+0x5a/0x5a
[ 49.289368] [<ffffffff81a82481>] x86_64_start_reservations+0x2a/0x2c
[ 49.289375] [<ffffffff81a82550>] x86_64_start_kernel+0xcd/0xd1
[ 49.289379] ---[ end trace 07a1cc95e29e9036 ]---
The warning is that 'rdtp->dynticks' has an unexpected value, which roughly
translates to - the calls to rcu_idle_enter() and rcu_idle_exit() were not
made in the correct order, or otherwise messed up.
And Bjørn's painstaking debugging indicated that this happens when the idle
loop enters the poll mode. Looking at the poll function cpu_idle_poll(), and
the implementation of trace_cpu_idle_rcuidle(), the problem becomes very clear:
cpu_idle_poll() lacks calls to rcu_idle_enter/exit(), and trace_cpu_idle_rcuidle()
calls them in the reverse order - first rcu_idle_exit(), and then rcu_idle_enter().
Hence the even/odd alternative sequencing of rdtp->dynticks goes for a toss.
And powertop readily triggers this because powertop uses the idle-tracing
infrastructure extensively.
So, to fix this, wrap the code in cpu_idle_poll() within rcu_idle_enter/exit(),
so that it blends properly with the calls inside trace_cpu_idle_rcuidle() and
thus get the function ordering right.
Reported-and-tested-by: Bjørn Mork <bjorn@mork.no>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Dipankar Sarma <dipankar@in.ibm.com>
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/519169BF.4080208@linux.vnet.ibm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2013-05-14 17:43:29 +02:00
..
cpu
rcu/idle: Wrap cpu-idle poll mode within rcu_idle_enter/exit
2013-05-14 17:43:29 +02:00
debug
kgdb/sysrq: fix inconstistent help message of sysrq key
2013-04-30 17:04:10 -07:00
events
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2013-04-30 07:41:01 -07:00
gcov
kernel/gcov: remove depends on CONFIG_EXPERIMENTAL
2013-01-11 11:39:33 -08:00
irq
proc: Supply a function to remove a proc entry by PDE
2013-05-01 17:29:46 -04:00
power
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
2013-05-02 19:40:34 -07:00
sched
Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2013-05-02 14:56:31 -07:00
time
clockevents: Set dummy handler on CPU_DEAD shutdown
2013-04-25 13:57:04 +02:00
trace
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2013-04-30 07:41:01 -07:00
.gitignore
kernel/hz.bc: ignore.
2013-04-22 07:09:06 -07:00
acct.c
lift sb_start_write() out of ->write()
2013-04-09 14:12:56 -04:00
async.c
async: rename and redefine async_func_ptr
2013-03-12 13:59:14 -07:00
audit.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
2013-05-01 14:08:52 -07:00
audit.h
audit: remove unnecessary #if CONFIG_AUDIT
2013-04-29 15:54:26 -07:00
audit_tree.c
kernel/audit_tree.c: tree will leak memory when failure occurs in audit_trim_trees()
2013-04-29 15:54:26 -07:00
audit_watch.c
audit: catch possible NULL audit buffers
2013-01-11 14:54:55 -08:00
auditfilter.c
kernel/auditfilter.c: tree and watch will memory leak when failure occurs
2013-04-29 15:54:26 -07:00
auditsc.c
kernel/auditsc.c: use kzalloc instead of kmalloc+memset
2013-04-29 15:54:26 -07:00
backtracetest.c
bounds.c
capability.c
Add file_ns_capable() helper function for open-time capability checking
2013-04-14 10:06:31 -07:00
cgroup.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
2013-05-01 17:51:54 -07:00
cgroup_freezer.c
cgroup: rename ->create/post_create/pre_destroy/destroy() to ->css_alloc/online/offline/free()
2012-11-19 08:13:38 -08:00
compat.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
2013-05-01 07:21:43 -07:00
configs.c
proc: Supply PDE attribute setting accessor functions
2013-05-01 17:29:18 -04:00
context_tracking.c
Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2013-02-19 18:19:48 -08:00
cpu.c
Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2013-02-19 19:04:55 -08:00
cpu_pm.c
cpuset.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
2013-05-01 17:51:54 -07:00
crash_dump.c
cred.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
2012-12-18 10:55:28 -08:00
delayacct.c
cputime: Use accessors to read task cputime stats
2013-01-27 19:23:31 +01:00
dma.c
elfcore.c
exec_domain.c
exit.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
2013-05-01 17:51:54 -07:00
extable.c
extable: Flip the sorting message
2013-04-15 13:25:16 +02:00
fork.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
2013-05-01 07:21:43 -07:00
freezer.c
futex.c
futex: fix kernel-doc notation and spello
2013-03-12 20:42:10 -07:00
futex_compat.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
2013-02-23 18:50:11 -08:00
groups.c
hrtimer.c
Merge branch 'linus' into timers/core
2013-04-24 20:33:54 +02:00
hung_task.c
irq_work.c
Merge branch 'nohz/printk-v8' into irq/core
2013-02-05 00:48:46 +01:00
itimer.c
jump_label.c
kallsyms.c
kcmp.c
kcmp: include linux/ptrace.h
2012-12-20 17:40:19 -08:00
Kconfig.freezer
Kconfig.hz
Kconfig.locks
Kconfig.preempt
kexec.c
kexec: Use min() and min_t() to simplify logic
2013-04-30 17:04:07 -07:00
kmod.c
kmod: remove call_usermodehelper_fns()
2013-04-30 17:04:06 -07:00
kprobes.c
kprobes: Fix a double lock bug of kprobe_mutex
2013-04-18 08:58:38 -07:00
ksysfs.c
Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2012-12-11 18:10:49 -08:00
kthread.c
kthread: implement probe_kthread_data()
2013-04-30 17:04:02 -07:00
latencytop.c
lglock.c
lockdep.c
lockdep: Consolidate bug messages into a single print_lockdep_off() function
2013-04-26 08:37:22 +02:00
lockdep_internals.h
lockdep_proc.c
lockdep_states.h
Makefile
idle: Provide a generic entry point for the idle code
2013-04-08 17:39:23 +02:00
modsign_certificate.S
MODSIGN: Avoid using .incbin in C source
2012-12-14 13:06:44 +10:30
modsign_pubkey.c
keys: use keyring_alloc() to create module signing keyring
2012-12-20 17:40:21 -08:00
module-internal.h
module.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
2013-02-26 20:16:07 -08:00
module_signing.c
MODSIGN: Don't use enum-type bitfields in module signature info block
2012-12-05 11:27:24 +10:30
mutex-debug.c
mutex-debug.h
mutex.c
mutex: Back out architecture specific check for negative mutex count
2013-04-19 09:33:36 +02:00
mutex.h
notifier.c
nsproxy.c
proc: Split the namespace stuff out into linux/proc_ns.h
2013-05-01 17:29:39 -04:00
padata.c
padata: use __this_cpu_read per-cpu helper
2012-12-06 17:16:23 +08:00
panic.c
dump_stack: implement arch-specific hardware description in task dumps
2013-04-30 17:04:02 -07:00
params.c
pid.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
2013-05-01 17:51:54 -07:00
pid_namespace.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
2013-05-01 17:51:54 -07:00
posix-cpu-timers.c
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2013-02-19 19:05:45 -08:00
posix-timers.c
posix-timers: Remove unused variable
2013-04-18 12:51:19 +02:00
printk.c
workqueue: include workqueue info when printing debug dump of a worker task
2013-04-30 17:04:02 -07:00
profile.c
proc: Supply PDE attribute setting accessor functions
2013-05-01 17:29:18 -04:00
ptrace.c
ptrace: add ability to retrieve signals without removing from a queue (v4)
2013-04-30 17:04:05 -07:00
range.c
kernel/range.c: subtract_range: fix the broken phrase issued by printk
2013-04-30 17:04:01 -07:00
rcu.h
rcu: Provide RCU CPU stall warnings for tiny RCU
2013-01-28 22:06:21 -08:00
rcupdate.c
Merge branches 'doctorture.2013.01.29a', 'fixes.2013.01.26a', 'tagcb.2013.01.24a' and 'tiny.2013.01.29b' into HEAD
2013-01-28 22:25:21 -08:00
rcutiny.c
Merge branches 'doctorture.2013.01.29a', 'fixes.2013.01.26a', 'tagcb.2013.01.24a' and 'tiny.2013.01.29b' into HEAD
2013-01-28 22:25:21 -08:00
rcutiny_plugin.h
rcu: Provide RCU CPU stall warnings for tiny RCU
2013-01-28 22:06:21 -08:00
rcutorture.c
rcu: Allow rcutorture to be built at low optimization levels
2013-02-04 12:18:20 -08:00
rcutree.c
Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2013-04-30 07:39:01 -07:00
rcutree.h
Merge branches 'doc.2013.03.12a', 'fixes.2013.03.13a' and 'idlenocb.2013.03.26b' into HEAD
2013-03-26 08:07:38 -07:00
rcutree_plugin.h
Merge branches 'doc.2013.03.12a', 'fixes.2013.03.13a' and 'idlenocb.2013.03.26b' into HEAD
2013-03-26 08:07:38 -07:00
rcutree_trace.c
rcu: Make RCU_FAST_NO_HZ take advantage of numbered callbacks
2013-03-26 08:04:51 -07:00
relay.c
relay: use macro PAGE_ALIGN instead of FIX_SIZE
2013-04-30 17:04:09 -07:00
res_counter.c
res_counter: return amount of charges after res_counter_uncharge()
2012-12-18 15:02:12 -08:00
resource.c
mem hotunplug: fix kfree() of bootmem memory
2013-04-29 15:54:40 -07:00
rtmutex-debug.c
sched/rt: Move rt specific bits into new header file
2013-02-07 20:51:08 +01:00
rtmutex-debug.h
rtmutex-tester.c
locking/rtmutex/tester: Set correct permissions on sysfs files
2013-04-10 14:48:37 +02:00
rtmutex.c
sched/rt: Move rt specific bits into new header file
2013-02-07 20:51:08 +01:00
rtmutex.h
rtmutex_common.h
rwsem.c
lockdep, rwsem: provide down_write_nest_lock()
2013-01-11 14:54:55 -08:00
seccomp.c
seccomp: allow BPF_XOR based ALU instructions.
2013-03-26 11:07:19 +11:00
semaphore.c
semaphore: use `bool' type for semaphore_waiter's up
2013-04-30 17:04:08 -07:00
signal.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
2013-05-01 14:08:52 -07:00
smp.c
kernel/smp.c: cleanups
2013-04-30 17:04:03 -07:00
smpboot.c
kthread: Prevent unpark race which puts threads on the wrong cpu
2013-04-12 14:18:43 +02:00
smpboot.h
softirq.c
kernel/smp.c: remove 'priv' of call_single_data
2013-04-30 17:04:03 -07:00
spinlock.c
srcu.c
srcu: use ACCESS_ONCE() to access sp->completed in srcu_read_lock()
2013-02-07 15:19:36 -08:00
stacktrace.c
stop_machine.c
stop_machine: Mark per cpu stopper enabled early
2013-02-26 22:25:17 +01:00
sys.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
2013-05-01 07:21:43 -07:00
sys_ni.c
merge compat sys_ipc instances
2013-03-03 23:00:27 -05:00
sysctl.c
mm: replace hardcoded 3% with admin_reserve_pages knob
2013-04-29 15:54:36 -07:00
sysctl_binary.c
sysctl: fix null checking in bin_dn_node_address()
2013-02-27 19:10:21 -08:00
task_work.c
taskstats.c
test_kprobes.c
kernel/: rename random32() to prandom_u32()
2013-04-29 18:28:42 -07:00
time.c
timekeeping: Use inject_offset in warp_clock
2013-03-15 16:50:20 -07:00
timeconst.bc
kernel: Replace timeconst.pl with a bc script
2013-02-16 23:17:25 +01:00
timer.c
kernel/timer.c: move some non timer related syscalls to kernel/sys.c
2013-04-30 17:04:03 -07:00
tracepoint.c
Tracing updates for Linux 3.10
2013-04-29 13:55:38 -07:00
tsacct.c
cputime: Use accessors to read task cputime stats
2013-01-27 19:23:31 +01:00
uid16.c
make SYSCALL_DEFINE<n>-generated wrappers do asmlinkage_protect
2013-03-03 22:58:33 -05:00
up.c
user-return-notifier.c
hlist: drop the node parameter from iterators
2013-02-27 19:10:24 -08:00
user.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
2013-05-01 17:51:54 -07:00
user_namespace.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
2013-05-01 17:51:54 -07:00
utsname.c
proc: Split the namespace stuff out into linux/proc_ns.h
2013-05-01 17:29:39 -04:00
utsname_sysctl.c
kernel/utsname_sysctl.c: put get/get_uts() into CONFIG_PROC_SYSCTL code block
2013-02-27 19:10:22 -08:00
wait.c
propagate name change to comments in kernel source
2012-12-06 10:39:54 +01:00
watchdog.c
watchdog: Add comments to explain the watchdog_disabled variable
2013-03-14 08:24:05 +01:00
workqueue.c
workqueue: include workqueue info when printing debug dump of a worker task
2013-04-30 17:04:02 -07:00
workqueue_internal.h
workqueue: include workqueue info when printing debug dump of a worker task
2013-04-30 17:04:02 -07:00