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 <[email protected]> Link: https://lore.kernel.org/r/CACkBjsbPVdkub=e-E-p1WBOLxS515ith-53SFdmFHWV_QMo40w@mail.gmail.com Suggested-by: Hao Sun <[email protected]> Signed-off-by: Michal Koutný <[email protected]> Reviewed-by: Shakeel Butt <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 8ab7745 commit eda0970

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)