Re: [PATCH 3/4] scsi: make sure that request queue queiesce and unquiesce balanced

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

 



On Wed, 2021-11-03 at 11:43 +0800, Ming Lei wrote:
[...]
> +void scsi_start_queue(struct scsi_device *sdev)
> +{
> +	if (cmpxchg(&sdev->queue_stopped, 1, 0))
> +		blk_mq_unquiesce_queue(sdev->request_queue);
> +}
> +
> +static void scsi_stop_queue(struct scsi_device *sdev, bool nowait)
> +{
> +	if (!cmpxchg(&sdev->queue_stopped, 0, 1)) {
> +		if (nowait)
> +			blk_mq_quiesce_queue_nowait(sdev-
> >request_queue);
> +		else
> +			blk_mq_quiesce_queue(sdev->request_queue);
> +	} else {
> +		if (!nowait)
> +			blk_mq_wait_quiesce_done(sdev->request_queue);
> +	}
> +}

This looks counter intuitive.  I assume it's done so that if we call
scsi_stop_queue when the queue has already been stopped, it waits until
the queue is actually quiesced before returning so the behaviour is the
same in the !nowait case?  Some sort of comment explaining that would
be useful.

James






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux