From: Suwan Kim <suwan.kim027@gmail.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: mst@redhat.com, jasowang@redhat.com, pbonzini@redhat.com,
mgurtovoy@nvidia.com, virtualization@lists.linux-foundation.org,
linux-block@vger.kernel.org, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v3 1/2] virtio-blk: support polling I/O
Date: Mon, 28 Mar 2022 23:40:52 +0900 [thread overview]
Message-ID: <YkHI9Ke8VSE0Wv/W@localhost.localdomain> (raw)
In-Reply-To: <YkGv2nr6m1MRSYxp@stefanha-x1.localdomain>
On Mon, Mar 28, 2022 at 01:53:46PM +0100, Stefan Hajnoczi wrote:
> On Thu, Mar 24, 2022 at 11:04:49PM +0900, Suwan Kim wrote:
> > +static int virtblk_poll(struct blk_mq_hw_ctx *hctx, struct io_comp_batch *iob)
> > +{
> > + struct virtio_blk_vq *vq = hctx->driver_data;
> > + struct virtblk_req *vbr;
> > + unsigned long flags;
> > + unsigned int len;
> > + int found = 0;
> > +
> > + spin_lock_irqsave(&vq->lock, flags);
> > +
> > + while ((vbr = virtqueue_get_buf(vq->vq, &len)) != NULL) {
> > + struct request *req = blk_mq_rq_from_pdu(vbr);
> > +
> > + found++;
> > + if (!blk_mq_add_to_batch(req, iob, vbr->status,
> > + virtblk_complete_batch))
> > + blk_mq_complete_request(req);
> > + }
> > +
> > + spin_unlock_irqrestore(&vq->lock, flags);
>
> virtblk_done() does:
>
> /* In case queue is stopped waiting for more buffers. */
> if (req_done)
> blk_mq_start_stopped_hw_queues(vblk->disk->queue, true);
>
> Is the same thing needed here in virtblk_poll() so that stopped queues
> are restarted when requests complete?
I think you are right. I missed that.
I just added blk_mq_start_stopped_hw_queues() to virtblk_poll as
you commented and did performance test again.
It showed higher peak performance than virtblk_poll without
blk_mq_start_stopped_hw_queues().
I will add it in next version.
Thanks for the comment!
Regards,
Suwan Kim
next prev parent reply other threads:[~2022-03-28 14:41 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-24 14:04 [PATCH v3 0/2] virtio-blk: support polling I/O and mq_ops->queue_rqs() Suwan Kim
2022-03-24 14:04 ` [PATCH v3 1/2] virtio-blk: support polling I/O Suwan Kim
2022-03-24 14:32 ` Michael S. Tsirkin
2022-03-24 14:32 ` Michael S. Tsirkin
2022-03-24 14:46 ` Suwan Kim
2022-03-24 17:56 ` Michael S. Tsirkin
2022-03-24 17:56 ` Michael S. Tsirkin
2022-03-26 12:00 ` Suwan Kim
2022-03-24 17:34 ` Dongli Zhang
2022-03-24 17:34 ` Dongli Zhang
2022-03-26 11:53 ` Suwan Kim
2022-03-24 17:58 ` Michael S. Tsirkin
2022-03-24 17:58 ` Michael S. Tsirkin
2022-03-26 12:44 ` Suwan Kim
2022-03-28 12:53 ` Stefan Hajnoczi
2022-03-28 12:53 ` Stefan Hajnoczi
2022-03-28 14:40 ` Suwan Kim [this message]
2022-03-24 14:04 ` [PATCH v3 2/2] virtio-blk: support mq_ops->queue_rqs() Suwan Kim
2022-03-28 13:16 ` Stefan Hajnoczi
2022-03-28 13:16 ` Stefan Hajnoczi
2022-03-28 15:50 ` Suwan Kim
2022-03-29 8:45 ` Stefan Hajnoczi
2022-03-29 8:45 ` Stefan Hajnoczi
2022-03-29 13:48 ` Suwan Kim
2022-03-29 15:01 ` Stefan Hajnoczi
2022-03-29 15:01 ` Stefan Hajnoczi
2022-03-29 15:54 ` Suwan Kim
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=YkHI9Ke8VSE0Wv/W@localhost.localdomain \
--to=suwan.kim027@gmail.com \
--cc=jasowang@redhat.com \
--cc=linux-block@vger.kernel.org \
--cc=lkp@intel.com \
--cc=mgurtovoy@nvidia.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=stefanha@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
/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.