android_kernel_xiaomi_sm8350/kernel
Tejun Heo 9398180097 workqueue: fix race condition in schedule_on_each_cpu()
Commit 65a6446434 ("HWPOISON: Allow
schedule_on_each_cpu() from keventd") which allows schedule_on_each_cpu()
to be called from keventd added a race condition.  schedule_on_each_cpu()
may race with cpu hotplug and end up executing the function twice on a
cpu.

Fix it by moving direct execution into the section protected with
get/put_online_cpus().  While at it, update code such that direct
execution is done after works have been scheduled for all other cpus and
drop unnecessary cpu != orig test from flush loop.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-11-17 17:40:33 -08:00
..
gcov
irq genirq: try_one_irq() must be called with irq disabled 2009-11-07 21:44:45 +01:00
power PM / Hibernate: Add newline to load_image() fail path 2009-11-03 11:03:09 +01:00
time headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
trace ftrace: Fix unmatched locking in ftrace_regex_write() 2009-11-04 01:42:10 -05:00
.gitignore
acct.c
async.c
audit_tree.c
audit_watch.c
audit.c
audit.h
auditfilter.c
auditsc.c
backtracetest.c
bounds.c
capability.c
cgroup_freezer.c
cgroup.c cgroup: fix strstrip() misuse 2009-10-29 07:39:25 -07:00
compat.c
configs.c
cpu.c
cpuset.c
cred-internals.h
cred.c
delayacct.c
dma.c
exec_domain.c
exit.c connector: fix regression introduced by sid connector 2009-10-29 07:39:25 -07:00
extable.c
fork.c Correct nr_processes() when CPUs have been unplugged 2009-11-03 07:52:39 -08:00
freezer.c
futex_compat.c
futex.c futex: Fix spurious wakeup for requeue_pi really 2009-10-28 20:34:34 +01:00
groups.c
hrtimer.c
hung_task.c
itimer.c
kallsyms.c
Kconfig.freezer
Kconfig.hz
Kconfig.preempt
kexec.c
kfifo.c
kgdb.c
kmod.c
kprobes.c
ksysfs.c
kthread.c sched: Fix kthread_bind() by moving the body of kthread_bind() to sched.c 2009-11-03 07:25:00 +01:00
latencytop.c
lockdep_internals.h
lockdep_proc.c
lockdep_states.h
lockdep.c
Makefile
module.c
mutex-debug.c headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
mutex-debug.h
mutex.c
mutex.h
notifier.c
ns_cgroup.c
nsproxy.c
panic.c
params.c param: fix setting arrays of bool 2009-10-29 08:56:20 +10:30
perf_event.c perf events: Don't generate events for the idle task when exclude_idle is set 2009-10-23 09:35:02 +02:00
pid_namespace.c
pid.c
pm_qos_params.c
posix-cpu-timers.c
posix-timers.c
printk.c
profile.c
ptrace.c
rcupdate.c
rcutorture.c
rcutree_plugin.h rcu: Fix TREE_PREEMPT_RCU CPU_HOTPLUG bad-luck hang 2009-10-15 20:33:01 +02:00
rcutree_trace.c
rcutree.c rcu: Fix long-grace-period race between forcing and initialization 2009-11-02 16:06:21 +01:00
rcutree.h rcu: Fix long-grace-period race between forcing and initialization 2009-11-02 16:06:21 +01:00
relay.c
res_counter.c
resource.c
rtmutex_common.h
rtmutex-debug.c
rtmutex-debug.h
rtmutex-tester.c
rtmutex.c
rtmutex.h
rwsem.c
sched_clock.c
sched_cpupri.c
sched_cpupri.h
sched_debug.c
sched_fair.c sched: Strengthen buddies and mitigate buddy induced latencies 2009-10-23 23:48:28 +02:00
sched_features.h
sched_idletask.c
sched_rt.c
sched_stats.h
sched.c sched: Use root_task_group_empty only with FAIR_GROUP_SCHED 2009-11-08 13:15:48 +01:00
seccomp.c
semaphore.c
signal.c
slow-work.c
smp.c
softirq.c
softlockup.c
spinlock.c
srcu.c
stacktrace.c
stop_machine.c
sys_ni.c
sys.c Merge branch 'hwpoison-2.6.32' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6 2009-10-29 08:20:00 -07:00
sysctl_check.c sysctl: fix false positives when PROC_SYSCTL=n 2009-10-29 07:39:30 -07:00
sysctl.c
taskstats.c
test_kprobes.c
time.c
timeconst.pl
timer.c
tracepoint.c
tsacct.c
uid16.c
up.c
user_namespace.c
user.c uids: Prevent tear down race 2009-11-02 16:02:39 +01:00
utsname_sysctl.c
utsname.c
wait.c
workqueue.c workqueue: fix race condition in schedule_on_each_cpu() 2009-11-17 17:40:33 -08:00