[GIT PULL] scheduler fixes

From: Ingo Molnar
Date: Sat Sep 28 2019 - 08:39:20 EST


Linus,

Please pull the latest sched-urgent-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched-urgent-for-linus

# HEAD: 4892f51ad54ddff2883a60b6ad4323c1f632a9d6 sched/fair: Avoid redundant EAS calculation

The changes are:

- Apply a number of membarrier related fixes and cleanups, which fixes a
use-after-free race in the membarrier code.

- Introduce proper RCU protection for tasks on the runqueue - to get rid
of the subtle task_rcu_dereference() interface that was easy to get
wrong.

- Misc fixes, but also an EAS speedup.

Thanks,

Ingo

------------------>
Eric W. Biederman (4):
tasks: Add a count of task RCU users
tasks, sched/core: Ensure tasks are available for a grace period after leaving the runqueue
tasks, sched/core: With a grace period after finish_task_switch(), remove unnecessary code
tasks, sched/core: RCUify the assignment of rq->curr

KeMeng Shi (1):
sched/core: Fix migration to invalid CPU in __set_cpus_allowed_ptr()

Mathieu Desnoyers (7):
sched/membarrier: Fix private expedited registration check
sched/membarrier: Remove redundant check
sched/membarrier: Call sync_core only before usermode for same mm
sched/membarrier: Fix p->mm->membarrier_state racy load
selftests, sched/membarrier: Add multi-threaded test
sched/membarrier: Skip IPIs when mm->mm_users == 1
sched/membarrier: Return -ENOMEM to userspace on memory allocation failure

Qian Cai (3):
sched/fair: Remove unused cfs_rq_clock_task() function
sched/core: Convert vcpu_is_preempted() from macro to an inline function
sched/fair: Fix -Wunused-but-set-variable warnings

Quentin Perret (1):
sched/fair: Avoid redundant EAS calculation

Valentin Schneider (2):
sched/core: Fix preempt_schedule() interrupt return comment
sched/core: Remove double update_max_interval() call on CPU startup


fs/exec.c | 2 +-
include/linux/mm_types.h | 14 +-
include/linux/rcuwait.h | 20 +-
include/linux/sched.h | 10 +-
include/linux/sched/mm.h | 10 +-
include/linux/sched/task.h | 2 +-
kernel/exit.c | 74 +------
kernel/fork.c | 8 +-
kernel/sched/core.c | 28 +--
kernel/sched/fair.c | 39 +---
kernel/sched/membarrier.c | 239 +++++++++++++--------
kernel/sched/sched.h | 34 +++
tools/testing/selftests/membarrier/.gitignore | 3 +-
tools/testing/selftests/membarrier/Makefile | 5 +-
.../{membarrier_test.c => membarrier_test_impl.h} | 40 ++--
.../membarrier/membarrier_test_multi_thread.c | 73 +++++++
.../membarrier/membarrier_test_single_thread.c | 24 +++
17 files changed, 375 insertions(+), 250 deletions(-)
rename tools/testing/selftests/membarrier/{membarrier_test.c => membarrier_test_impl.h} (95%)
create mode 100644 tools/testing/selftests/membarrier/membarrier_test_multi_thread.c
create mode 100644 tools/testing/selftests/membarrier/membarrier_test_single_thread.c