android_kernel_motorola_sm6375/kernel/sched
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Andy Lutomirski c4f9094070 membarrier: Explicitly sync remote cores when SYNC_CORE is requested
commit 758c9373d84168dc7d039cf85a0e920046b17b41 upstream.

membarrier() does not explicitly sync_core() remote CPUs; instead, it
relies on the assumption that an IPI will result in a core sync.  On x86,
this may be true in practice, but it's not architecturally reliable.  In
particular, the SDM and APM do not appear to guarantee that interrupt
delivery is serializing.  While IRET does serialize, IPI return can
schedule, thereby switching to another task in the same mm that was
sleeping in a syscall.  The new task could then SYSRET back to usermode
without ever executing IRET.

Make this more robust by explicitly calling sync_core_before_usermode()
on remote cores.  (This also helps people who search the kernel tree for
instances of sync_core() and sync_core_before_usermode() -- one might be
surprised that the core membarrier code doesn't currently show up in a
such a search.)

Fixes: 70216e18e5 ("membarrier: Provide core serializing command, *_SYNC_CORE")
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/776b448d5f7bd6b12690707f5ed67bcda7f1d427.1607058304.git.luto@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-21 13:27:07 +01:00
..
autogroup.c
autogroup.h
clock.c
completion.c
core.c sched/features: Fix !CONFIG_JUMP_LABEL case 2020-10-29 09:58:00 +01:00
cpuacct.c
cpudeadline.c
cpudeadline.h
cpufreq.c
cpufreq_schedutil.c sched/uclamp: Protect uclamp fast path code with static key 2020-09-03 11:26:49 +02:00
cpupri.c
cpupri.h
cputime.c
deadline.c sched/deadline: Initialize ->dl_boosted 2020-06-30 15:37:02 -04:00
debug.c sched/debug: Make sd->flags sysctl read-only 2020-07-09 09:37:50 +02:00
fair.c sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list 2020-12-08 10:40:24 +01:00
features.h
idle.c
isolation.c
loadavg.c timers/nohz: Update NOHZ load in remote tick 2020-03-05 16:43:36 +01:00
Makefile
membarrier.c membarrier: Explicitly sync remote cores when SYNC_CORE is requested 2020-12-21 13:27:07 +01:00
pelt.c
pelt.h
psi.c
rt.c sched: Defend cfs and rt bandwidth quota against overflow 2020-06-22 09:31:07 +02:00
sched-pelt.h
sched.h sched/features: Fix !CONFIG_JUMP_LABEL case 2020-10-29 09:58:00 +01:00
stats.c
stats.h
stop_task.c
swait.c
topology.c sched: correct SD_flags returned by tl->sd_flags() 2020-08-19 08:15:54 +02:00
wait.c
wait_bit.c