android_kernel_motorola_sm6225/arch/s390/kernel
Heiko Carstens 0008204ffe s390/idle: fix sequence handling vs cpu hotplug
The s390 idle accounting code uses a sequence counter which gets used
when the per cpu idle statistics get updated and read.

One assumption on read access is that only when the sequence counter is
even and did not change while reading all values the result is valid.
On cpu hotplug however the per cpu data structure gets initialized via
a cpu hotplug notifier on CPU_ONLINE.
CPU_ONLINE however is too late, since the onlined cpu is already running
and might access the per cpu data. Worst case is that the data structure
gets initialized while an idle thread is updating its idle statistics.
This will result in an uneven sequence counter after an update.

As a result user space tools like top, which access /proc/stat in order
to get idle stats, will busy loop waiting for the sequence counter to
become even again, which will never happen until the queried cpu will
update its idle statistics again. And even then the sequence counter
will only have an even value for a couple of cpu cycles.

Fix this by moving the initialization of the per cpu idle statistics
to cpu_init(). I prefer that solution in favor of changing the
notifier to CPU_UP_PREPARE, which would be a different solution to
the problem.

Cc: stable@vger.kernel.org
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2012-07-17 10:34:27 +02:00
..
vdso32 s390: add various .gitignore files. 2012-05-16 14:42:41 +02:00
vdso64 s390: add various .gitignore files. 2012-05-16 14:42:41 +02:00
.gitignore s390: add various .gitignore files. 2012-05-16 14:42:41 +02:00
asm-offsets.c s390/smp: make absolute lowcore / cpu restart parameter accesses more robust 2012-06-14 09:09:02 +02:00
audit.c [S390] Get rid of a bunch of sparse warnings again. 2007-10-12 16:13:06 +02:00
audit.h [S390] Get rid of a bunch of sparse warnings again. 2007-10-12 16:13:06 +02:00
base.S s390/sigp: use sigp order code defines in assembly code 2012-06-05 13:23:36 +02:00
bitmap.c [S390] move EXPORT_SYMBOLs to definitions 2009-03-26 15:24:11 +01:00
compat_audit.c [S390] Get rid of a bunch of sparse warnings again. 2007-10-12 16:13:06 +02:00
compat_exec_domain.c [S390] Get rid of a lot of sparse warnings. 2007-02-05 21:16:47 +01:00
compat_linux.c userns: Convert stat to return values mapped from kuids and kgids 2012-05-15 14:08:35 -07:00
compat_linux.h Mark arguments to certain syscalls as being const 2010-08-13 16:53:13 -07:00
compat_ptrace.h [S390] ptrace cleanup 2011-01-05 12:47:31 +01:00
compat_signal.c new helper: signal_delivered() 2012-06-01 12:58:52 -04:00
compat_wrapper.S sys_poll: fix incorrect type for 'timeout' parameter 2012-02-21 17:24:20 -08:00
cpcmd.c Disintegrate asm/system.h for S390 2012-03-28 18:30:02 +01:00
crash.c [S390] Get rid of a lot of sparse warnings. 2007-02-05 21:16:47 +01:00
crash_dump.c [S390] kernel: Add OS info memory interface 2012-03-11 11:59:29 -04:00
debug.c [S390] kernel: Add z/VM LGR detection 2012-03-11 11:59:29 -04:00
diag.c [S390] replace diag10() with diag10_range() function 2011-05-10 17:13:43 +02:00
dis.c Disintegrate asm/system.h for S390 2012-03-28 18:30:02 +01:00
early.c s390/kexec: Move early_pgm_check_handler() to text section 2012-05-23 17:06:52 +02:00
ebcdic.c [S390] Get rid of a lot of sparse warnings. 2007-02-05 21:16:47 +01:00
entry.h pull clearing RESTORE_SIGMASK into block_sigmask() 2012-06-01 12:58:49 -04:00
entry.S s390/smp: make absolute lowcore / cpu restart parameter accesses more robust 2012-06-14 09:09:02 +02:00
entry64.S s390/smp: make absolute lowcore / cpu restart parameter accesses more robust 2012-06-14 09:09:02 +02:00
ftrace.c [S390] cleanup ftrace backend functions 2011-01-05 12:47:31 +01:00
head.S s390/ipl: remove builtin tape ipl code 2012-05-16 14:42:40 +02:00
head31.S [S390] smp: external call vs. emergency signal 2011-10-30 15:16:44 +01:00
head64.S [S390] smp: external call vs. emergency signal 2011-10-30 15:16:44 +01:00
head_kdump.S s390/sigp: use sigp order code defines in assembly code 2012-06-05 13:23:36 +02:00
ipl.c s390/ipl: Fix ipib handling for "dumpreipl" shutdown action 2012-06-27 19:21:32 +02:00
irq.c s390/irq: split irq stats for cpu-measurement alert facilities 2012-05-23 17:06:52 +02:00
jump_label.c s390/jump-label: add arch_jump_label_transform_static() 2011-10-25 11:54:37 -07:00
kprobes.c [S390] sparse: fix sparse static warnings 2011-10-30 15:16:46 +01:00
lgr.c [S390] Fix build errors (fallout from system.h disintegration) 2012-03-30 09:41:12 +02:00
machine_kexec.c s390/kdump: Use real mode for PSW restart and kexec 2012-05-23 17:06:51 +02:00
Makefile s390: Use generic init_task 2012-05-05 13:00:25 +02:00
mcount.S [S390] fix s390 assembler code alignments 2011-07-24 10:48:21 +02:00
mcount64.S [S390] fix s390 assembler code alignments 2011-07-24 10:48:21 +02:00
mem_detect.c [S390] Rework create_mem_hole() function 2011-12-27 11:27:09 +01:00
module.c modules: make arch's use default loader hooks 2011-07-24 22:06:04 +09:30
nmi.c [S390] rework idle code 2012-03-11 11:59:28 -04:00
os_info.c s390/smp: make absolute lowcore / cpu restart parameter accesses more robust 2012-06-14 09:09:02 +02:00
perf_cpum_cf.c s390/irq: split irq stats for cpu-measurement alert facilities 2012-05-23 17:06:52 +02:00
perf_event.c [S390] Fix build errors (fallout from system.h disintegration) 2012-03-30 09:41:12 +02:00
process.c Disintegrate asm/system.h for S390 2012-03-28 18:30:02 +01:00
processor.c s390/idle: fix sequence handling vs cpu hotplug 2012-07-17 10:34:27 +02:00
ptrace.c seccomp: ignore secure_computing return values 2012-04-18 12:24:50 +10:00
reipl.S s390/sigp: use sigp order code defines in assembly code 2012-06-05 13:23:36 +02:00
reipl64.S s390/sigp: use sigp order code defines in assembly code 2012-06-05 13:23:36 +02:00
relocate_kernel.S s390/sigp: use sigp order code defines in assembly code 2012-06-05 13:23:36 +02:00
relocate_kernel64.S s390/sigp: use sigp order code defines in assembly code 2012-06-05 13:23:36 +02:00
s390_ksyms.c [S390] move sie code to entry.S 2011-07-24 10:48:21 +02:00
sclp.S [S390] fix s390 assembler code alignments 2011-07-24 10:48:21 +02:00
setup.c s390/smp: make absolute lowcore / cpu restart parameter accesses more robust 2012-06-14 09:09:02 +02:00
signal.c new helper: signal_delivered() 2012-06-01 12:58:52 -04:00
smp.c s390/idle: fix sequence handling vs cpu hotplug 2012-07-17 10:34:27 +02:00
stacktrace.c [S390] Fix stacktrace compile bug. 2008-07-17 17:22:09 +02:00
suspend.c Disintegrate asm/system.h for S390 2012-03-28 18:30:02 +01:00
swsusp_asm64.S s390/sigp: use sigp order code defines in assembly code 2012-06-05 13:23:36 +02:00
sys_s390.c [S390] ipc: call generic sys_ipc demultiplexer 2011-12-27 11:27:13 +01:00
syscalls.S [S390] wire up process_vm syscalls 2011-11-14 11:19:08 +01:00
sysinfo.c s390/cpu: remove cpu "capabilities" sysfs attribute 2012-05-30 09:07:30 +02:00
time.c [S390] irq: external interrupt code passing 2012-03-11 11:59:29 -04:00
topology.c [S390] rework smp code 2012-03-11 11:59:28 -04:00
traps.c Disintegrate asm/system.h for S390 2012-03-28 18:30:02 +01:00
vdso.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
vmlinux.lds.S [S390] cleanup entry point definition 2012-01-18 18:03:41 +01:00
vtime.c [S390] irq: external interrupt code passing 2012-03-11 11:59:29 -04:00