All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Keith Busch <kbusch@kernel.org>, linux-nvme@lists.infradead.org
Cc: hch@lst.de, sagi@grimberg.me
Subject: Re: [PATCH] nvme/pci: fix queue_rqs list splitting
Date: Wed, 22 Dec 2021 17:04:04 -0700	[thread overview]
Message-ID: <e8422de4-3f45-ebe5-dd23-e1dce96290f5@kernel.dk> (raw)
In-Reply-To: <20211222214159.1767965-1-kbusch@kernel.org>

On 12/22/21 2:41 PM, Keith Busch wrote:
> If command prep fails, current handling will orphan subsequent requests
> in the list. Consider a simple example:
> 
>   rqlist = [ 1 -> 2 ]
> 
> When prep for request '1' fails, it will be appended to the
> 'requeue_list', leaving request '2' disconnected from the original
> rqlist and no longer tracked. Meanwhile, rqlist is still pointing to the
> failed 'req' and will attempt to submit the unprepped command.
> 
> Fix this by updating the rqlist accordingly.

Good catch.

> Just IMO, the rq list manipulation looks a bit fragile for the lld. If
> more drivers want to subscribe to the new .queue_rqs() interface, I have
> another patch set ready for consideration with helper macros to make
> this sort of error handling a little easier for re-use.

I'd love to make it so that the driver didn't need the list manipulation,
but I also don't want to turn it into Yet Another indirect call. We could
potentially do the same trick as was done for:

commit c234a65392062504acf04afe0ae404cca61a8e1a
Author: Jens Axboe <axboe@kernel.dk>
Date:   Fri Oct 8 05:59:37 2021 -0600

    nvme: add support for batched completion of polled IO

where the function pointer is known and gcc turns it into a direct
call instead?

-- 
Jens Axboe



  reply	other threads:[~2021-12-23  0:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-22 21:41 [PATCH] nvme/pci: fix queue_rqs list splitting Keith Busch
2021-12-23  0:04 ` Jens Axboe [this message]
2021-12-23  6:20 ` 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=e8422de4-3f45-ebe5-dd23-e1dce96290f5@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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.