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>
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -35,7 +35,7 @@ void cgroup_rstat_updated(struct cgroup *cgrp, int cpu) · 34 unmodified lines | |||
| 35 | * instead of NULL, we can tell whether @cgrp is on the list by | 35 | * instead of NULL, we can tell whether @cgrp is on the list by |
| 36 | * testing the next pointer for NULL. | 36 | * testing the next pointer for NULL. |
| 37 | */ | 37 | */ |
| 38 | if (cgroup_rstat_cpu(cgrp, cpu)->updated_next) | 38 | if (data_race(cgroup_rstat_cpu(cgrp, cpu)->updated_next)) |
| 39 | return; | 39 | return; |
| 40 | 40 | ||
| 41 | raw_spin_lock_irqsave(cpu_lock, flags); | 41 | raw_spin_lock_irqsave(cpu_lock, flags); |