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 Sat, Apr 12, 2025 at 12:43:10AM +0530, Nilay Shroff wrote:
> 
> 
> On 4/10/25 7:00 PM, Ming Lei wrote:
> > @@ -5081,7 +5087,18 @@ static void __blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set,
> >  void blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, int nr_hw_queues)
> >  {
> >  	mutex_lock(&set->tag_list_lock);
> > +	/*
> > +	 * Mark us in updating nr_hw_queues for preventing switching
> > +	 * elevator
> > +	 *
> > +	 * Elevator switch code can _not_ acquire ->tag_list_lock
> > +	 */
> > +	set->flags |= BLK_MQ_F_UPDATE_HW_QUEUES;
> > +	synchronize_srcu(&set->update_nr_hwq_srcu);
> > +
> >  	__blk_mq_update_nr_hw_queues(set, nr_hw_queues);
> > +
> > +	set->flags &= BLK_MQ_F_UPDATE_HW_QUEUES;
> 
> I think here we want to clear BLK_MQ_F_UPDATE_HW_QUEUES, so we need to
> have set->flags updated as below:
> 
> set->flags &= ~BLK_MQ_F_UPDATE_HW_QUEUES;

Good catch!


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