Skip to content

Commit 0f0d1b8

Browse files
KAGA-KOKOPeter Zijlstra
authored andcommitted
sched/ext: Remove sched_fork() hack
Instead of solving the underlying problem of the double invocation of __sched_fork() for idle tasks, sched-ext decided to hack around the issue by partially clearing out the entity struct to preserve the already enqueued node. A provided analysis and solution has been ignored for four months. Now that someone else has taken care of cleaning it up, remove the disgusting hack and clear out the full structure. Remove the comment in the structure declaration as well, as there is no requirement for @node being the last element anymore. Fixes: f0e1a06 ("sched_ext: Implement BPF extensible scheduler class") Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Tejun Heo <[email protected]> Link: https://lore.kernel.org/r/87ldy82wkc.ffs@tglx
1 parent b23decf commit 0f0d1b8

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

include/linux/sched/ext.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ struct sched_ext_entity {
199199
#ifdef CONFIG_EXT_GROUP_SCHED
200200
struct cgroup *cgrp_moving_from;
201201
#endif
202-
/* must be the last field, see init_scx_entity() */
203202
struct list_head tasks_node;
204203
};
205204

kernel/sched/ext.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3548,12 +3548,7 @@ static void scx_ops_exit_task(struct task_struct *p)
35483548

35493549
void init_scx_entity(struct sched_ext_entity *scx)
35503550
{
3551-
/*
3552-
* init_idle() calls this function again after fork sequence is
3553-
* complete. Don't touch ->tasks_node as it's already linked.
3554-
*/
3555-
memset(scx, 0, offsetof(struct sched_ext_entity, tasks_node));
3556-
3551+
memset(scx, 0, sizeof(*scx));
35573552
INIT_LIST_HEAD(&scx->dsq_list.node);
35583553
RB_CLEAR_NODE(&scx->dsq_priq);
35593554
scx->sticky_cpu = -1;

0 commit comments

Comments
 (0)