Patch "sched/ext: Remove sched_fork() hack" has been added to the 6.12-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    sched/ext: Remove sched_fork() hack

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     sched-ext-remove-sched_fork-hack.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 782162e40e46135b94a32aec60ed6b41678fc36b
Author: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Date:   Mon Oct 28 14:20:35 2024 +0100

    sched/ext: Remove sched_fork() hack
    
    [ Upstream commit 0f0d1b8e5010bfe1feeb4d78d137e41946a5370d ]
    
    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: f0e1a0643a59 ("sched_ext: Implement BPF extensible scheduler class")
    Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
    Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
    Acked-by: Tejun Heo <tj@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/87ldy82wkc.ffs@tglx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/include/linux/sched/ext.h b/include/linux/sched/ext.h
index 1ddbde64a31b4..2799e7284fff7 100644
--- a/include/linux/sched/ext.h
+++ b/include/linux/sched/ext.h
@@ -199,7 +199,6 @@ struct sched_ext_entity {
 #ifdef CONFIG_EXT_GROUP_SCHED
 	struct cgroup		*cgrp_moving_from;
 #endif
-	/* must be the last field, see init_scx_entity() */
 	struct list_head	tasks_node;
 };
 
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 751d73d500e51..ecb88c5285447 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -3567,12 +3567,7 @@ static void scx_ops_exit_task(struct task_struct *p)
 
 void init_scx_entity(struct sched_ext_entity *scx)
 {
-	/*
-	 * init_idle() calls this function again after fork sequence is
-	 * complete. Don't touch ->tasks_node as it's already linked.
-	 */
-	memset(scx, 0, offsetof(struct sched_ext_entity, tasks_node));
-
+	memset(scx, 0, sizeof(*scx));
 	INIT_LIST_HEAD(&scx->dsq_list.node);
 	RB_CLEAR_NODE(&scx->dsq_priq);
 	scx->sticky_cpu = -1;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux