diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-28 15:39:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-28 15:39:07 -0400 |
commit | 9c5efe9ae7df78600c0ee7bcce27516eb687fa6e (patch) | |
tree | 158cfb9720d876e68a14a4cccaffeb58fb7baac5 /kernel/fork.c | |
parent | aefcf2f4b58155d27340ba5f9ddbe9513da8286d (diff) | |
parent | 4892f51ad54ddff2883a60b6ad4323c1f632a9d6 (diff) |
Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler fixes from Ingo Molnar:
- 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
* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
sched/fair: Avoid redundant EAS calculation
sched/core: Remove double update_max_interval() call on CPU startup
sched/core: Fix preempt_schedule() interrupt return comment
sched/fair: Fix -Wunused-but-set-variable warnings
sched/core: Fix migration to invalid CPU in __set_cpus_allowed_ptr()
sched/membarrier: Return -ENOMEM to userspace on memory allocation failure
sched/membarrier: Skip IPIs when mm->mm_users == 1
selftests, sched/membarrier: Add multi-threaded test
sched/membarrier: Fix p->mm->membarrier_state racy load
sched/membarrier: Call sync_core only before usermode for same mm
sched/membarrier: Remove redundant check
sched/membarrier: Fix private expedited registration check
tasks, sched/core: RCUify the assignment of rq->curr
tasks, sched/core: With a grace period after finish_task_switch(), remove unnecessary code
tasks, sched/core: Ensure tasks are available for a grace period after leaving the runqueue
tasks: Add a count of task RCU users
sched/core: Convert vcpu_is_preempted() from macro to an inline function
sched/fair: Remove unused cfs_rq_clock_task() function
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 60763c043aa3..f9572f416126 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -915,10 +915,12 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node) | |||
915 | tsk->cpus_ptr = &tsk->cpus_mask; | 915 | tsk->cpus_ptr = &tsk->cpus_mask; |
916 | 916 | ||
917 | /* | 917 | /* |
918 | * One for us, one for whoever does the "release_task()" (usually | 918 | * One for the user space visible state that goes away when reaped. |
919 | * parent) | 919 | * One for the scheduler. |
920 | */ | 920 | */ |
921 | refcount_set(&tsk->usage, 2); | 921 | refcount_set(&tsk->rcu_users, 2); |
922 | /* One for the rcu users */ | ||
923 | refcount_set(&tsk->usage, 1); | ||
922 | #ifdef CONFIG_BLK_DEV_IO_TRACE | 924 | #ifdef CONFIG_BLK_DEV_IO_TRACE |
923 | tsk->btrace_seq = 0; | 925 | tsk->btrace_seq = 0; |
924 | #endif | 926 | #endif |