summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2026-07-23 15:07:56 -1000
committerTejun Heo <tj@kernel.org>2026-07-25 10:33:24 -1000
commit6ee471b646e09203f8dca27ffff78bb454dc97ac (patch)
tree920e34b02b8315e55c7059125bb5a2ab1a43b0ee
parentce228343010df67e0a35bd1a9980abcfdf9cf95f (diff)
downloadlinux-next-6ee471b646e09203f8dca27ffff78bb454dc97ac.tar.gz
linux-next-6ee471b646e09203f8dca27ffff78bb454dc97ac.zip
sched_ext: Use rcu_access_pointer() for the first_task comparison
dsq->first_task is __rcu for the lockless scx_bpf_dsq_peek(). The task removal path compares it against the departing task with a plain load, which sparse flags. The comparison runs under the dsq lock and only tests identity, so rcu_access_pointer() is the fit. Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r--kernel/sched/ext/ext.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/ext/ext.c b/kernel/sched/ext/ext.c
index 2002ab0f7c9b..79dc258515e7 100644
--- a/kernel/sched/ext/ext.c
+++ b/kernel/sched/ext/ext.c
@@ -1654,7 +1654,7 @@ static void task_unlink_from_dsq(struct task_struct *p,
list_del_init(&p->scx.dsq_list.node);
dsq_dec_nr(dsq, p);
- if (!(dsq->id & SCX_DSQ_FLAG_BUILTIN) && dsq->first_task == p) {
+ if (!(dsq->id & SCX_DSQ_FLAG_BUILTIN) && rcu_access_pointer(dsq->first_task) == p) {
struct task_struct *first_task;
first_task = nldsq_next_task(dsq, NULL, false);