aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorHarshit Agarwal <harshit@nutanix.com>2024-11-14 14:08:11 -0700
committerPeter Zijlstra <peterz@infradead.org>2024-12-02 12:01:30 +0100
commit59297e2093ceced86393a059a4bd36802311f7bb (patch)
treebd5704c304fadbadc358240810b7c8f4b8ea05ac
parentsched: Don't try to catch up excess steal time. (diff)
downloadwireguard-linux-59297e2093ceced86393a059a4bd36802311f7bb.tar.xz
wireguard-linux-59297e2093ceced86393a059a4bd36802311f7bb.zip
sched: add READ_ONCE to task_on_rq_queued
task_on_rq_queued read p->on_rq without READ_ONCE, though p->on_rq is set with WRITE_ONCE in {activate|deactivate}_task and smp_store_release in __block_task, and also read with READ_ONCE in task_on_rq_migrating. Make all of these accesses pair together by adding READ_ONCE in the task_on_rq_queued. Signed-off-by: Harshit Agarwal <harshit@nutanix.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Phil Auld <pauld@redhat.com> Link: https://lkml.kernel.org/r/20241114210812.1836587-1-jon@nutanix.com
-rw-r--r--kernel/sched/sched.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 76f5f53a645f..0f6790c5279b 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -2271,7 +2271,7 @@ static inline int task_on_cpu(struct rq *rq, struct task_struct *p)
static inline int task_on_rq_queued(struct task_struct *p)
{
- return p->on_rq == TASK_ON_RQ_QUEUED;
+ return READ_ONCE(p->on_rq) == TASK_ON_RQ_QUEUED;
}
static inline int task_on_rq_migrating(struct task_struct *p)