History

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>

Michal Koutný committed 5 years ago

Commit eda09701 parent 8ab77451 file · +1 −1Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/cgroup/rstat.c+1−1
@@ -35,7 +35,7 @@ void cgroup_rstat_updated(struct cgroup *cgrp, int cpu) · 34 unmodified lines
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);