All of lore.kernel.org
 help / color / mirror / Atom feed
From: axboe@kernel.dk (Jens Axboe)
Subject: [PATCH 06/12] nvme: switch abort to blk_execute_rq_nowait
Date: Mon, 9 Nov 2015 14:46:58 -0700	[thread overview]
Message-ID: <56411452.8060509@kernel.dk> (raw)
In-Reply-To: <20151109212844.GD5386@localhost.localdomain>

On 11/09/2015 02:33 PM, Keith Busch wrote:
> On Sat, Nov 07, 2015@09:45:00AM +0100, Christoph Hellwig wrote:
>> And remove the new unused nvme_submit_cmd helper.
>>
>> Signed-off-by: Christoph Hellwig <hch at lst.de>
>> ---
>>   drivers/nvme/host/core.c |  8 +++---
>>   drivers/nvme/host/nvme.h |  2 +-
>>   drivers/nvme/host/pci.c  | 66 ++++++++++++++++++++----------------------------
>>   3 files changed, 32 insertions(+), 44 deletions(-)
>>
>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
>> index 37f7d69..3600a0c 100644
>> --- a/drivers/nvme/host/core.c
>> +++ b/drivers/nvme/host/core.c
>> @@ -86,12 +86,12 @@ void nvme_requeue_req(struct request *req)
>>   }
>>
>>   struct request *nvme_alloc_request(struct request_queue *q,
>> -		struct nvme_command *cmd)
>> +		struct nvme_command *cmd, bool nowait)
>>   {
>>   	bool write = cmd->common.opcode & 1;
>>   	struct request *req;
>>
>> -	req = blk_mq_alloc_request(q, write, GFP_KERNEL, false);
>> +	req = blk_mq_alloc_request(q, write, GFP_KERNEL, nowait);
>
> The "nowait" flag tells blk_mq_alloc_request to allocate out of the
> reserved tags, but we've reserved only one of these for AEN requests.
> Your next patch changes the AEN notification a bit, but this will still
> create a command id conflict for the controller.

Looks like a mixup of __GFP_WAIT and 'reserved'. Looks like we need to 
pass in both 'nowait' and 'reserved' to nvme_alloc_request(), so it can 
do the right thing.

Though both call sites should tolerate sleeping, since we changed the 
timeout handler to be in process context.

-- 
Jens Axboe

  reply	other threads:[~2015-11-09 21:46 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-07  8:44 nvme completion path optimizations and fixes V3 Christoph Hellwig
2015-11-07  8:44 ` [PATCH 01/12] block: fix blk_abort_request for blk-mq drivers Christoph Hellwig
2015-11-07  8:44 ` [PATCH 02/12] block: defer timeouts to a workqueue Christoph Hellwig
2015-11-07  8:44 ` [PATCH 03/12] nvme: factor out a nvme_unmap_data helper Christoph Hellwig
2015-11-09 18:47   ` Keith Busch
2015-11-09 18:56     ` Christoph Hellwig
2015-11-07  8:44 ` [PATCH 04/12] nvme: factor out a few helpers from req_completion Christoph Hellwig
2015-11-07  8:44 ` [PATCH 05/12] nvme: switch delete SQ/CQ to blk_execute_rq_nowait Christoph Hellwig
2015-11-07  8:45 ` [PATCH 06/12] nvme: switch abort " Christoph Hellwig
2015-11-09 21:33   ` Keith Busch
2015-11-09 21:46     ` Jens Axboe [this message]
2015-11-10  5:56       ` Christoph Hellwig
2015-11-07  8:45 ` [PATCH 07/12] nvme: special case AEN requests Christoph Hellwig
2015-11-09 21:43   ` Keith Busch
2015-11-09 21:48     ` Jens Axboe
2015-11-10  5:57       ` Christoph Hellwig
2015-11-07  8:45 ` [PATCH 08/12] nvme: simplify completion handling Christoph Hellwig
2015-11-07  8:45 ` [PATCH 09/12] nvme: properly free resources for cancelled command Christoph Hellwig
2015-11-09 18:57   ` Keith Busch
2015-11-09 19:25     ` Christoph Hellwig
2015-11-09 20:12       ` Keith Busch
2015-11-10  8:13         ` Christoph Hellwig
2015-11-10 16:03           ` Keith Busch
2015-11-10 20:28             ` Keith Busch
2015-11-16 10:05               ` Christoph Hellwig
2015-11-07  8:45 ` [PATCH 10/12] nvme: meta_sg doesn't have to be an array Christoph Hellwig
2015-11-07  8:45 ` [PATCH 11/12] nvme: merge iod and cmd_info Christoph Hellwig
2015-11-07  8:45 ` [PATCH 12/12] block: remove REQ_NO_TIMEOUT flag Christoph Hellwig

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=56411452.8060509@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.