linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: axboe@kernel.dk (Jens Axboe)
Subject: [PATCH 1/3] nvme: remove ->cq_vector == -1 check in nvme_queue_rq()
Date: Thu, 17 May 2018 09:36:58 -0600	[thread overview]
Message-ID: <2d5e6a8b-b7fb-a0fa-614f-5888fdf0e8be@kernel.dk> (raw)
In-Reply-To: <20180517153204.GA23555@localhost.localdomain>

On 5/17/18 9:32 AM, Keith Busch wrote:
> On Thu, May 17, 2018@09:02:15AM -0600, Jens Axboe wrote:
>> We only clear this after calling nvme_suspend_queue(), which must
>> have called nvme_stop_queues() first. The latter ensures that no
>> more IO is queued, or in progress of being queued, against this
>> hardware queue.
>>
>> Signed-off-by: Jens Axboe <axboe at kernel.dk>
>> ---
>>  drivers/nvme/host/pci.c | 5 -----
>>  1 file changed, 5 deletions(-)
>>
>> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
>> index 5277afc6e7b5..4ed3583ad3bc 100644
>> --- a/drivers/nvme/host/pci.c
>> +++ b/drivers/nvme/host/pci.c
>> @@ -887,11 +887,6 @@ static blk_status_t nvme_queue_rq(struct blk_mq_hw_ctx *hctx,
>>  	blk_mq_start_request(req);
>>  
>>  	spin_lock_irq(&nvmeq->q_lock);
>> -	if (unlikely(nvmeq->cq_vector < 0)) {
>> -		ret = BLK_STS_IOERR;
>> -		spin_unlock_irq(&nvmeq->q_lock);
>> -		goto out_cleanup_iod;
>> -	}
>>  	__nvme_submit_cmd(nvmeq, &cmnd);
>>  	spin_unlock_irq(&nvmeq->q_lock);
>>  	return BLK_STS_OK;
> 
> Unfortunatley we are still relying on this to drain entered requests on
> a dying queue: we restart them to flush to out requests to complete with
> error. :(
> 
> There's probably a better way to handle this.

I'd suggest we just move it to the top and get it out of the way instead,
and ensure that the ->cq_vector to -1 includes an mb(). Then we can just
make it:

if (unlikely(nvmeq->cq_vector < 0))
        return BLK_STS_IOERR;

-- 
Jens Axboe

  reply	other threads:[~2018-05-17 15:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17 15:02 [PATCHSET 0/3] Split queue lock into submission/completion locks Jens Axboe
2018-05-17 15:02 ` [PATCH 1/3] nvme: remove ->cq_vector == -1 check in nvme_queue_rq() Jens Axboe
2018-05-17 15:30   ` Christoph Hellwig
2018-05-17 15:32   ` Keith Busch
2018-05-17 15:36     ` Jens Axboe [this message]
2018-05-17 15:42       ` Jens Axboe
2018-05-17 15:52         ` Keith Busch
2018-05-17 15:52           ` Jens Axboe
2018-05-17 16:00             ` Christoph Hellwig
2018-05-17 15:44       ` Keith Busch
2018-05-17 15:02 ` [PATCH 2/3] nvme: split the nvme queue lock into submission and completion locks Jens Axboe
2018-05-17 15:33   ` Christoph Hellwig
2018-05-17 15:33     ` Jens Axboe
2018-05-17 15:02 ` [PATCH 3/3] nvme: drop IRQ disabling on submission queue lock Jens Axboe
2018-05-17 15:33   ` Christoph Hellwig
2018-05-17 15:22 ` [PATCHSET 0/3] Split queue lock into submission/completion locks Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d5e6a8b-b7fb-a0fa-614f-5888fdf0e8be@kernel.dk \
    --to=axboe@kernel.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).