The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] block/bfq-cgroup: use data_race() for online test
@ 2026-08-03 13:41 Tao Cui
  2026-08-04  2:08 ` yu kuai
  2026-08-04  2:18 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Tao Cui @ 2026-08-03 13:41 UTC (permalink / raw)
  To: axboe, yukuai
  Cc: tj, josef, cgroups, linux-block, linux-kernel, cui.tao, Tao Cui

From: Tao Cui <cuitao@kylinos.cn>

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 <cuitao@kylinos.cn>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] block/bfq-cgroup: use data_race() for online test
  2026-08-03 13:41 [PATCH] block/bfq-cgroup: use data_race() for online test Tao Cui
@ 2026-08-04  2:08 ` yu kuai
  2026-08-04  2:18 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: yu kuai @ 2026-08-04  2:08 UTC (permalink / raw)
  To: Tao Cui, axboe, yu kuai
  Cc: tj, josef, cgroups, linux-block, linux-kernel, Tao Cui

在 2026/8/3 21:41, Tao Cui 写道:

> From: Tao Cui<cuitao@kylinos.cn>
>
> 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<cuitao@kylinos.cn>
> ---
>   block/bfq-cgroup.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Yu Kuai <yukuai@fygo.io>

-- 
Thanks,
Kuai

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] block/bfq-cgroup: use data_race() for online test
  2026-08-03 13:41 [PATCH] block/bfq-cgroup: use data_race() for online test Tao Cui
  2026-08-04  2:08 ` yu kuai
@ 2026-08-04  2:18 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2026-08-04  2:18 UTC (permalink / raw)
  To: yukuai, Tao Cui; +Cc: tj, josef, cgroups, linux-block, linux-kernel, Tao Cui


On Mon, 03 Aug 2026 21:41:04 +0800, Tao Cui wrote:
> 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,
-- 
Jens Axboe




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-04  2:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-03 13:41 [PATCH] block/bfq-cgroup: use data_race() for online test Tao Cui
2026-08-04  2:08 ` yu kuai
2026-08-04  2:18 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox