Re: [PATCH 04/15] block: prevent elevator switch during updating nr_hw_queues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux