Skip to content

Commit eda0970

Browse files
Werkovhtejun
authored andcommitted
cgroup: rstat: Mark benign data race to silence KCSAN
There is a race between updaters and flushers (flush can possibly miss the latest update(s)). This is expected as explained in cgroup_rstat_updated() comment, add also machine readable annotation so that KCSAN results aren't noisy. Reported-by: Hao Sun <sunhao.th@gmail.com> Link: https://lore.kernel.org/r/CACkBjsbPVdkub=e-E-p1WBOLxS515ith-53SFdmFHWV_QMo40w@mail.gmail.com Suggested-by: Hao Sun <sunhao.th@gmail.com> Signed-off-by: Michal Koutný <mkoutny@suse.com> Reviewed-by: Shakeel Butt <shakeelb@google.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 8ab7745 commit eda0970

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/cgroup/rstat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void cgroup_rstat_updated(struct cgroup *cgrp, int cpu)
3535
* instead of NULL, we can tell whether @cgrp is on the list by
3636
* testing the next pointer for NULL.
3737
*/
38-
if (cgroup_rstat_cpu(cgrp, cpu)->updated_next)
38+
if (data_race(cgroup_rstat_cpu(cgrp, cpu)->updated_next))
3939
return;
4040

4141
raw_spin_lock_irqsave(cpu_lock, flags);

0 commit comments

Comments
 (0)