Skip to content

Commit

Permalink
6.12: misc-additions: Revert sched_ext: scx_bpf_dispatch_from_dsq_set…
Browse files Browse the repository at this point in the history
  • Loading branch information
Tk-Glitch committed Dec 5, 2024
1 parent 3cdd962 commit bab5159
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions linux-tkg-patches/6.12/0012-misc-additions.patch
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,68 @@ index a54663f2e2ab9f..7ffad3eb0a0150 100644
case IP_VERSION(13, 0, 14):
case IP_VERSION(11, 0, 7):
case IP_VERSION(11, 0, 11):

From acf588f9b6fb560e986365c6b175aaf589ef1f2a Mon Sep 17 00:00:00 2001
From: Tejun Heo <tj@kernel.org>
Date: Sat, 9 Nov 2024 09:40:25 -1000
Subject: REVERT: sched_ext: scx_bpf_dispatch_from_dsq_set_*() are allowed from
unlocked context

[ Upstream commit 72b85bf6a7f6f6c38c39a1e5b04bc1da1bf5016e ]

diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index ecb88c52854475..16613631543f18 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -6473,8 +6473,6 @@ __bpf_kfunc_end_defs();

BTF_KFUNCS_START(scx_kfunc_ids_unlocked)
BTF_ID_FLAGS(func, scx_bpf_create_dsq, KF_SLEEPABLE)
-BTF_ID_FLAGS(func, scx_bpf_dispatch_from_dsq_set_slice)
-BTF_ID_FLAGS(func, scx_bpf_dispatch_from_dsq_set_vtime)
BTF_ID_FLAGS(func, scx_bpf_dispatch_from_dsq, KF_RCU)
BTF_ID_FLAGS(func, scx_bpf_dispatch_vtime_from_dsq, KF_RCU)
BTF_KFUNCS_END(scx_kfunc_ids_unlocked)
--
cgit 1.2.3-korg

From 09162013082267af54bb39091b523a8daaa28955 Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
Date: Mon, 28 Oct 2024 14:20:35 +0100
Subject: REVERT: sched/ext: Remove sched_fork() hack

[ Upstream commit 0f0d1b8e5010bfe1feeb4d78d137e41946a5370d ]

diff --git a/include/linux/sched/ext.h b/include/linux/sched/ext.h
index 1ddbde64a31b4a..2799e7284fff72 100644
--- a/include/linux/sched/ext.h
+++ b/include/linux/sched/ext.h
@@ -199,6 +199,7 @@ 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 751d73d500e51d..ecb88c52854475 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -3567,7 +3567,12 @@ 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;
--
cgit 1.2.3-korg

1 comment on commit bab5159

@Aarqw12
Copy link

@Aarqw12 Aarqw12 commented on bab5159 Dec 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.