Skip to contentSkip to conversation

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

PATCH Applied Tao Cui 3 participants 3 messages Aug 3 – Aug 4

Subsystems (4)
lore
Share & tools
lore

Tao Cui

author
#0 lore raw

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

From: Tao Cui <[email protected]>

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.

---
 block/bfq-cgroup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
block/bfq-cgroup.c +2 -2
index e82ff03bda02..ef9d63e8542e 100644
@@ -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);
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Tao Cui

From: Tao Cui<[email protected]>

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.

---
  block/bfq-cgroup.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 2 lines
Thanks,
Kuai
maintainer Applied
#2 lore raw
In reply to Tao Cui
Quoted 3 lines · Tao Cui

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.

Applied, thanks!

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

      commit: cbe81d612038fa3fb986a1e31fe7b8f808079cf1

Best regards,

Signature · 1 line
Jens Axboe