Skip to content

Commit 18966f7

Browse files
paulmckrcuneeraju
authored andcommitted
rcu-tasks: Mark RCU Tasks accesses to current->rcu_tasks_idle_cpu
The task_struct structure's ->rcu_tasks_idle_cpu can be concurrently read and written from the RCU Tasks grace-period kthread and from the CPU on which the task_struct structure's task is running. This commit therefore marks the accesses appropriately. Reported-by: Boqun Feng <boqun.feng@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org> Signed-off-by: Neeraj Upadhyay (AMD) <neeraj.iitr10@gmail.com>
1 parent 98b1cc8 commit 18966f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/rcu/tasks.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ static void check_holdout_task(struct task_struct *t,
975975
t->rcu_tasks_nvcsw != READ_ONCE(t->nvcsw) ||
976976
!rcu_tasks_is_holdout(t) ||
977977
(IS_ENABLED(CONFIG_NO_HZ_FULL) &&
978-
!is_idle_task(t) && t->rcu_tasks_idle_cpu >= 0)) {
978+
!is_idle_task(t) && READ_ONCE(t->rcu_tasks_idle_cpu) >= 0)) {
979979
WRITE_ONCE(t->rcu_tasks_holdout, false);
980980
list_del_init(&t->rcu_tasks_holdout_list);
981981
put_task_struct(t);
@@ -993,7 +993,7 @@ static void check_holdout_task(struct task_struct *t,
993993
t, ".I"[is_idle_task(t)],
994994
"N."[cpu < 0 || !tick_nohz_full_cpu(cpu)],
995995
t->rcu_tasks_nvcsw, t->nvcsw, t->rcu_tasks_holdout,
996-
t->rcu_tasks_idle_cpu, cpu);
996+
data_race(t->rcu_tasks_idle_cpu), cpu);
997997
sched_show_task(t);
998998
}
999999

0 commit comments

Comments
 (0)