Re: [PATCH v3] block/blk-iocost: annotate ioc_pd_stat reads with data_race()
Tejun Heo <[email protected]> Mon, 3 Aug 2026 20:42:11 -1000
| Newsgroups | org.kernel.vger.linux-block,org.kernel.vger.cgroups,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Aug 04, 2026 at 01:41:20PM +0800, Tao Cui wrote: > From: Tao Cui <[email protected]> > > ioc_pd_stat() reads ioc->enabled, ioc->vtime_base_rate, and > iocg->last_stat without holding ioc->lock, which trips KCSAN since > ioc_adjust_base_vrate() and iocg_flush_stat_upward() write those > fields under ioc->lock. > > Commit 35198e323001 fixed the same issue in ioc_qos_prfill() and > ioc_cost_model_prfill() by adding spin_lock_irq(&ioc->lock). However, > those functions read configuration parameters (qos/model) that need > synchronized reads. In contrast, ioc_pd_stat() only reads stat > values (vrate, usage) where stale reads are harmless, so data_race() > is more appropriate — it silences the KCSAN warning without adding > lock contention during high-frequency stat reads. > > Signed-off-by: Tao Cui <[email protected]> Acked-by: Tejun Heo <[email protected]> Thanks. -- tejun