All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Uday Shankar <ushankar@purestorage.com>
Cc: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org
Subject: Re: [PATCH] ublk: eliminate unnecessary io_cmds queue
Date: Wed, 16 Oct 2024 10:29:56 +0800	[thread overview]
Message-ID: <Zw8lJDo8Xh3epbjq@fedora> (raw)
In-Reply-To: <Zw7Vwsh3G25bbl93@dev-ushankar.dev.purestorage.com>

On Tue, Oct 15, 2024 at 02:51:14PM -0600, Uday Shankar wrote:
> On Thu, Oct 10, 2024 at 11:45:03AM +0800, Ming Lei wrote:
> > >  static void ublk_queue_cmd(struct ublk_queue *ubq, struct request *rq)
> > >  {
> > > -	struct ublk_rq_data *data = blk_mq_rq_to_pdu(rq);
> > > -
> > > -	if (llist_add(&data->node, &ubq->io_cmds)) {
> > > -		struct ublk_io *io = &ubq->ios[rq->tag];
> > > +	struct ublk_io *io = &ubq->ios[rq->tag];
> > >  
> > > -		io_uring_cmd_complete_in_task(io->cmd, ublk_rq_task_work_cb);
> > > -	}
> > > +	ublk_get_uring_cmd_pdu(io->cmd)->req = rq;
> > > +	io_uring_cmd_complete_in_task(io->cmd, __ublk_rq_task_work);
> > >  }
> > 
> > I'd suggest to comment that io_uring_cmd_complete_in_task() needs to
> > maintain io command order.
> 
> Sorry, can you explain why this is important? Generally speaking
> out-of-order completion of I/Os is considered okay, so what's the issue
> if the dispatch to the ublk server here is not in order?

It is just okay, but proper implementation requires to keep IO order.

Please see:

1) 7d4a93176e01 ("ublk_drv: don't forward io commands in reserve order")

2) [Report] requests are submitted to hardware in reverse order from nvme/virtio-blk queue_rqs()

https://lore.kernel.org/linux-block/ZbD7ups50ryrlJ%2FG@fedora/


I am also working on ublk-bpf which needs this extra list for submitting
IO in batch, please hold on this patch now.

I plan to send out bpf patches in this cycle or next, and we can restart
the cleanup if the bpf thing turns out not doable.


Thanks, 
Ming


      reply	other threads:[~2024-10-16  2:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09 19:37 [PATCH] ublk: eliminate unnecessary io_cmds queue Uday Shankar
2024-10-10  3:45 ` Ming Lei
2024-10-15 20:51   ` Uday Shankar
2024-10-16  2:29     ` Ming Lei [this message]

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=Zw8lJDo8Xh3epbjq@fedora \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --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.