android_kernel_samsung_msm8976/kernel
Subbaraman Narayanamurthy 283743680e kthread: Fix the race condition when kthread is parked
While stressing the CPU hotplug path, sometimes we hit a problem
as shown below.

[57056.416774] ------------[ cut here ]------------
[57056.489232] ksoftirqd/1 (14): undefined instruction: pc=c01931e8
[57056.489245] Code: e594a000 eb085236 e15a0000 0a000000 (e7f001f2)
[57056.489259] ------------[ cut here ]------------
[57056.492840] kernel BUG at kernel/kernel/smpboot.c:134!
[57056.513236] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
[57056.519055] Modules linked in: wlan(O) mhi(O)
[57056.523394] CPU: 0 PID: 14 Comm: ksoftirqd/1 Tainted: G        W  O 3.10.0-g3677c61-00008-g180c060 #1
[57056.532595] task: f0c8b000 ti: f0e78000 task.ti: f0e78000
[57056.537991] PC is at smpboot_thread_fn+0x124/0x218
[57056.542750] LR is at smpboot_thread_fn+0x11c/0x218
[57056.547528] pc : [<c01931e8>]    lr : [<c01931e0>]    psr: 200f0013
[57056.547528] sp : f0e79f30  ip : 00000000  fp : 00000000
[57056.558983] r10: 00000001  r9 : 00000000  r8 : f0e78000
[57056.564192] r7 : 00000001  r6 : c1195758  r5 : f0e78000  r4 : f0e5fd00
[57056.570701] r3 : 00000001  r2 : f0e79f20  r1 : 00000000  r0 : 00000000

This issue was always seen in the context of "ksoftirqd". It seems to
be happening because of a potential race condition in __kthread_parkme
where just after completing the parked completion, before the
ksoftirqd task has been scheduled again, it can go into running state.

Fix this by waiting for the task state to parked after waiting the
parked completion.

CRs-Fixed: 659674
Change-Id: If3f0e9b706eeb5d30d5a32f84378d35bb03fe794
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2015-06-04 17:43:41 -07:00
..
cpu idle: Implement a per-cpu idle-polling mode 2014-11-12 22:49:15 -08:00
debug This is the 3.10.73 stable release 2015-04-24 18:14:57 -07:00
events This is the 3.10.67 stable release 2015-04-24 18:04:40 -07:00
gcov
irq irq: pm: Remove unused variable 2015-03-19 14:59:30 -07:00
locking sched/deadline: Add SCHED_DEADLINE inheritance logic 2015-05-19 19:16:01 -07:00
power This is the 3.10.67 stable release 2015-04-24 18:04:40 -07:00
rcu locking: Move the rtmutex code to kernel/locking/ 2015-05-19 19:15:50 -07:00
sched timer: Queue timers on least power cpu 2015-05-29 15:59:20 +05:30
time This is the 3.10.73 stable release 2015-04-24 18:14:57 -07:00
trace sched/deadline: Add SCHED_DEADLINE inheritance logic 2015-05-19 19:16:01 -07:00
.gitignore
Kconfig.freezer
Kconfig.hz
Kconfig.locks printk: Make the console flush configurable in hotplug path 2014-11-18 19:16:25 -07:00
Kconfig.preempt
Makefile locking: Move the lglocks code to kernel/locking/ 2015-05-19 19:15:52 -07:00
acct.c
async.c
audit.c CAPABILITIES: remove undefined caps from all processes 2014-09-17 09:03:57 -07:00
audit.h
audit_tree.c audit: keep inode pinned 2014-11-21 09:22:52 -08:00
audit_watch.c
auditfilter.c
auditsc.c auditsc: audit_krule mask accesses need bounds checking 2014-06-16 13:42:53 -07:00
backtracetest.c
bounds.c
capability.c CAPABILITIES: remove undefined caps from all processes 2014-09-17 09:03:57 -07:00
cgroup.c cgroup: refactor allow_attach function into common code 2015-03-19 14:59:17 -07:00
cgroup_freezer.c
compat.c
configs.c
context_tracking.c
cpu.c CPU hotplug: Provide lockless versions of callback registration functions 2014-07-01 13:42:54 -07:00
cpu_pm.c cpu_pm: Add level to the cluster pm notification 2015-01-07 22:31:58 -08:00
cpuset.c cpuset,mempolicy: fix sleeping function called from invalid context 2014-07-17 15:58:00 -07:00
crash_dump.c
cred.c
delayacct.c
dma.c
elfcore.c
exec_domain.c
exit.c exit: Add PANIC_ON_RECURSIVE_FAULT Kconfig option 2015-03-31 22:32:59 -07:00
extable.c
fork.c sched/deadline: Add SCHED_DEADLINE inheritance logic 2015-05-19 19:16:01 -07:00
freezer.c This is the 3.10.67 stable release 2015-04-24 18:04:40 -07:00
futex.c rtmutex: Turn the plist into an rb-tree 2015-05-19 19:16:01 -07:00
futex_compat.c
groups.c userns: Don't allow setgroups until a gid mapping has been setablished 2015-01-08 09:58:16 -08:00
hrtimer.c timer/hrtimer: reprogram remote CPU's timer hardware 2015-05-29 15:59:36 +05:30
hung_task.c
irq_work.c irq_work: Implement remote queueing 2015-05-29 15:26:11 +05:30
itimer.c
jump_label.c
kallsyms.c
kcmp.c kcmp: fix standard comparison bug 2014-10-05 14:54:13 -07:00
kexec.c
kmod.c arch: Mass conversion of smp_mb__*() 2014-08-15 11:45:28 -07:00
kprobes.c
ksysfs.c
kthread.c kthread: Fix the race condition when kthread is parked 2015-06-04 17:43:41 -07:00
latencytop.c
modsign_certificate.S
modsign_pubkey.c
module-internal.h
module.c kasan, module, vmalloc: rework shadow allocation for modules 2015-05-04 14:03:58 -07:00
module_signing.c
notifier.c
nsproxy.c
padata.c
panic.c
params.c
pid.c This is the 3.10.67 stable release 2015-04-24 18:04:40 -07:00
pid_namespace.c pid_namespace: pidns_get() should check task_active_pid_ns() != NULL 2014-04-26 17:15:34 -07:00
posix-cpu-timers.c
posix-timers.c posix-timers: Fix stack info leak in timer_create() 2014-11-14 08:48:00 -08:00
printk.c This is the 3.10.67 stable release 2015-04-24 18:04:40 -07:00
profile.c profile: Fix CPU hotplug callback registration 2014-07-01 13:52:28 -07:00
ptrace.c
range.c
relay.c
res_counter.c
resource.c kernel: Restrict permissions of /proc/iomem. 2015-02-09 16:17:30 -08:00
seccomp.c seccomp: Replace BUG(!spin_is_locked()) with assert_spin_lock 2015-03-19 14:52:57 -07:00
signal.c
smp.c irq_work: Implement remote queueing 2015-05-29 15:26:11 +05:30
smpboot.c smpboot: use kmemleak_not_leak for smpboot_thread_data 2015-05-11 17:07:29 +05:30
smpboot.h
softirq.c nohz: Convert a few places to use local per cpu accesses 2014-08-15 11:46:54 -07:00
stacktrace.c
stop_machine.c
sys.c prctl: make PR_SET_TIMERSLACK_PID pid namespace aware 2015-03-19 14:59:56 -07:00
sys_ni.c seccomp: add "seccomp" syscall 2015-03-19 14:52:50 -07:00
sysctl.c timer: Queue timers on least power cpu 2015-05-29 15:59:20 +05:30
sysctl_binary.c
task_work.c
taskstats.c
test_kprobes.c
time.c time: settimeofday: Validate the values of tv from user 2015-01-29 17:40:56 -08:00
timeconst.bc
timer.c timer/hrtimer: reprogram remote CPU's timer hardware 2015-05-29 15:59:36 +05:30
tracepoint.c tracepoint: Do not waste memory on mods with no tracepoints 2014-05-30 21:52:11 -07:00
tsacct.c
uid16.c groups: Consolidate the setgroups permission checks 2015-01-08 09:58:16 -08:00
up.c
user-return-notifier.c
user.c userns: Add a knob to disable setgroups on a per user namespace basis 2015-01-08 09:58:16 -08:00
user_namespace.c userns: Allow setting gid_maps without privilege when setgroups is disabled 2015-01-08 09:58:17 -08:00
utsname.c
utsname_sysctl.c
watchdog.c
workqueue.c This is the 3.10.73 stable release 2015-04-24 18:14:57 -07:00
workqueue_internal.h