On Mon, Apr 14, 2025 at 08:07:54AM +0200, Christoph Hellwig wrote: > On Mon, Apr 14, 2025 at 08:54:36AM +0800, Ming Lei wrote: > > > > elv_iosched_load_module(name); > > > > > > > > + idx = srcu_read_lock(&set->update_nr_hwq_srcu); > > > > + > > > > + if (set->flags & BLK_MQ_F_UPDATE_HW_QUEUES) { > > > > > > What provides atomicity for field modifications vs reading of set->flags? > > > i.e. does this need to switch using test/set_bit? > > > > WRITE is serialized via tag set lock with synchronize_srcu(). > > > > READ is covered by srcu read lock. > > > > It is typical RCU usage, one writer vs. multiple writer. > > No, (S)RCU does not help you with atomicy of bitfields. OK, will change it into one state variable. Thanks, Ming