blkcg_set_delay() sets use_delay before updating delay_nsec and without memory barriers against blkcg_maybe_throttle_blkg(). Document that observing the two fields out of sync is harmless because throttling is approximate. Link: https://lore.kernel.org/442deed128ab064df56fd74a4100b8f5@kernel.org Suggested-by: Tejun Heo Signed-off-by: Gui-Dong Han --- v2: - Document the benign race in a comment instead of reordering and adding barriers, as suggested by Tejun Heo. v1: https://lore.kernel.org/20261130133403.3789095-1-hanguidong02@gmail.com block/blk-cgroup.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index 1fd60cb4157c..d01c460d439c 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h @@ -441,6 +441,10 @@ static inline void blkcg_set_delay(struct blkcg_gq *blkg, u64 delay) if (!old && atomic_try_cmpxchg(&blkg->use_delay, &old, -1)) blkcg_inc_congestion_count(blkg->blkcg); + /* + * Readers can see use_delay and delay_nsec out of sync, which is + * harmless as throttling is approximate. + */ atomic64_set(&blkg->delay_nsec, delay); } base-commit: 28a23309c8e40d651faf4cc3cc9b71458a11b987 -- 2.34.1