Thread (3 messages) flat view 3 messages, 3 authors, 3d ago
WARM3d

[PATCH] block/bfq-cgroup: use data_race() for online test

From: Tao Cui <hidden>
Date: 2026-08-03 13:41:18
Also in: cgroups, lkml
Subsystem: bfq i/o scheduler, block layer, control group - block io controller (blkio), the rest · Maintainers: Yu Kuai, Jens Axboe, Tejun Heo, Josef Bacik, Linus Torvalds

From: Tao Cui <redacted>

bfqg_prfill_stat_recursive() and bfq_bio_bfqg() read blkg->online
locklessly, same as blkg_rwstat_recursive_sum().  Annotate with
data_race() to silence KCSAN.

Signed-off-by: Tao Cui <redacted>
---
 block/bfq-cgroup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c
index e82ff03bda02..ef9d63e8542e 100644
--- a/block/bfq-cgroup.c
+++ b/block/bfq-cgroup.c
@@ -610,7 +610,7 @@ struct bfq_group *bfq_bio_bfqg(struct bfq_data *bfqd, struct bio *bio)
 	struct bfq_group *bfqg;
 
 	while (blkg) {
-		if (!blkg->online) {
+		if (!data_race(blkg->online)) {
 			blkg = blkg->parent;
 			continue;
 		}
@@ -1168,7 +1168,7 @@ static u64 bfqg_prfill_stat_recursive(struct seq_file *sf,
 		struct blkg_policy_data *pd;
 		struct bfq_stat *stat;
 
-		if (!pos_blkg->online)
+		if (!data_race(pos_blkg->online))
 			continue;
 
 		pd = blkg_to_pd(pos_blkg, &blkcg_policy_bfq);
-- 
2.43.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help