diff options
author | Peter Zijlstra <peterz@infradead.org> | 2021-03-29 15:18:35 +0200 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2021-05-12 11:43:31 +0200 |
commit | 85dd3f61203c5cfa72b308ff327b5fbf3fc1ce5e (patch) | |
tree | ace8780b1ed4212015463c4566c075d08259d46c /include/linux/sched.h | |
parent | 6e33cad0af49336952e5541464bd02f5b5fd433e (diff) | |
download | lwn-85dd3f61203c5cfa72b308ff327b5fbf3fc1ce5e.tar.gz lwn-85dd3f61203c5cfa72b308ff327b5fbf3fc1ce5e.zip |
sched: Inherit task cookie on fork()
Note that sched_core_fork() is called from under tasklist_lock, and
not from sched_fork() earlier. This avoids a few races later.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Don Hiatt <dhiatt@digitalocean.com>
Tested-by: Hongyu Ning <hongyu.ning@linux.intel.com>
Tested-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lkml.kernel.org/r/20210422123308.980003687@infradead.org
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index eab3f7c4251b..fba47e52e482 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -2181,8 +2181,10 @@ const struct cpumask *sched_trace_rd_span(struct root_domain *rd); #ifdef CONFIG_SCHED_CORE extern void sched_core_free(struct task_struct *tsk); +extern void sched_core_fork(struct task_struct *p); #else static inline void sched_core_free(struct task_struct *tsk) { } +static inline void sched_core_fork(struct task_struct *p) { } #endif #endif |