All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Uday Shankar <ushankar@purestorage.com>, Ming Lei <ming.lei@redhat.com>
Cc: linux-block@vger.kernel.org
Subject: Re: [PATCH] ublk: remove io_cmds list in ublk_queue
Date: Tue, 18 Mar 2025 12:22:57 -0600	[thread overview]
Message-ID: <c91dfaf8-d925-4f6d-8ced-06ecb395a360@kernel.dk> (raw)
In-Reply-To: <20250318-ublk_io_cmds-v1-1-c1bb74798fef@purestorage.com>

On 3/18/25 12:14 PM, Uday Shankar wrote:
> The current I/O dispatch mechanism - queueing I/O by adding it to the
> io_cmds list (and poking task_work as needed), then dispatching it in
> ublk server task context by reversing io_cmds and completing the
> io_uring command associated to each one - was introduced by commit
> 7d4a93176e014 ("ublk_drv: don't forward io commands in reserve order")
> to ensure that the ublk server received I/O in the same order that the
> block layer submitted it to ublk_drv. This mechanism was only needed for
> the "raw" task_work submission mechanism, since the io_uring task work
> wrapper maintains FIFO ordering (using quite a similar mechanism in
> fact). The "raw" task_work submission mechanism is no longer supported
> in ublk_drv as of commit 29dc5d06613f2 ("ublk: kill queuing request by
> task_work_add"), so the explicit llist/reversal is no longer needed - it
> just duplicates logic already present in the underlying io_uring APIs.
> Remove it.

Patch looks good to me, just one followup:

> diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
> index 2955900ee713c5d8f3cbc2a69f6f6058348e5253..82c9d3d22f0ea5a0fad3f33837fa16146b5af7a9 100644
> --- a/drivers/block/ublk_drv.c
> +++ b/drivers/block/ublk_drv.c
> @@ -77,8 +77,6 @@
>  	 UBLK_PARAM_TYPE_DMA_ALIGN)
>  
>  struct ublk_rq_data {
> -	struct llist_node node;
> -
>  	struct kref ref;
>  };

Can we get rid of ublk_rq_data then? If it's just a ref thing, I'm sure
we can find an atomic_t of space in struct request and avoid it. Not a
pressing thing, just tossing it out there...

-- 
Jens Axboe

  reply	other threads:[~2025-03-18 18:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-18 18:14 [PATCH] ublk: remove io_cmds list in ublk_queue Uday Shankar
2025-03-18 18:22 ` Jens Axboe [this message]
2025-03-18 18:43   ` Uday Shankar
2025-03-18 18:48     ` Jens Axboe
2025-03-18 21:58       ` Uday Shankar
2025-03-19  1:54         ` Jens Axboe
2025-03-19  1:04       ` Ming Lei
2025-03-19  1:57         ` Jens Axboe
2025-03-19  2:14 ` Ming Lei
2025-03-19 12:32 ` 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=c91dfaf8-d925-4f6d-8ced-06ecb395a360@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=ushankar@purestorage.com \
    /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.