]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
sched_ext: Add @kargs to scx_fork()
authorTejun Heo <tj@kernel.org>
Fri, 6 Mar 2026 17:58:02 +0000 (07:58 -1000)
committerTejun Heo <tj@kernel.org>
Fri, 6 Mar 2026 17:58:02 +0000 (07:58 -1000)
Make sched_cgroup_fork() pass @kargs to scx_fork(). This will be used to
determine @p's cgroup for cgroup sub-sched support.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
Cc: Peter Zijlstra <peterz@infradead.org>
kernel/sched/core.c
kernel/sched/ext.c
kernel/sched/ext.h

index b7f77c165a6e044eaa1f6812ae31770906ba22c1..dfe680e78be38e2542bf85cfa40e02bf096183e1 100644 (file)
@@ -4721,7 +4721,7 @@ int sched_cgroup_fork(struct task_struct *p, struct kernel_clone_args *kargs)
                p->sched_class->task_fork(p);
        raw_spin_unlock_irqrestore(&p->pi_lock, flags);
 
-       return scx_fork(p);
+       return scx_fork(p, kargs);
 }
 
 void sched_cancel_fork(struct task_struct *p)
index 1ff4cf93413ba8b2fd2a564aa14641000e13ab3f..6f98a979391fa5314f300a05d9dbf003eb0e8d2b 100644 (file)
@@ -3171,7 +3171,7 @@ void scx_pre_fork(struct task_struct *p)
        percpu_down_read(&scx_fork_rwsem);
 }
 
-int scx_fork(struct task_struct *p)
+int scx_fork(struct task_struct *p, struct kernel_clone_args *kargs)
 {
        percpu_rwsem_assert_held(&scx_fork_rwsem);
 
index 43429b33e52c11976e7d9770594367e9992f5a68..0b7fc46aee08c82f5950fda3a0a4991eacce835a 100644 (file)
@@ -11,7 +11,7 @@
 void scx_tick(struct rq *rq);
 void init_scx_entity(struct sched_ext_entity *scx);
 void scx_pre_fork(struct task_struct *p);
-int scx_fork(struct task_struct *p);
+int scx_fork(struct task_struct *p, struct kernel_clone_args *kargs);
 void scx_post_fork(struct task_struct *p);
 void scx_cancel_fork(struct task_struct *p);
 bool scx_can_stop_tick(struct rq *rq);
@@ -44,7 +44,7 @@ bool scx_prio_less(const struct task_struct *a, const struct task_struct *b,
 
 static inline void scx_tick(struct rq *rq) {}
 static inline void scx_pre_fork(struct task_struct *p) {}
-static inline int scx_fork(struct task_struct *p) { return 0; }
+static inline int scx_fork(struct task_struct *p, struct kernel_clone_args *kargs) { return 0; }
 static inline void scx_post_fork(struct task_struct *p) {}
 static inline void scx_cancel_fork(struct task_struct *p) {}
 static inline u32 scx_cpuperf_target(s32 cpu) { return 0; }