From: Stefan Hajnoczi <stefanha@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: virtualization@lists.linux-foundation.org,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
Christoph Hellwig <hch@lst.de>,
Paolo Bonzini <pbonzini@redhat.com>, Jens Axboe <axboe@kernel.dk>,
slp@redhat.com, sgarzare@redhat.com,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH 1/3] virtio: add virtioqueue_more_used()
Date: Tue, 25 May 2021 09:48:12 +0100 [thread overview]
Message-ID: <YKy5zCoPpp8CDAOI@stefanha-x1.localdomain> (raw)
In-Reply-To: <dc4a4d96-53b1-5358-cfdd-61795283fd88@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1403 bytes --]
On Tue, May 25, 2021 at 10:23:39AM +0800, Jason Wang wrote:
>
> 在 2021/5/20 下午10:13, Stefan Hajnoczi 写道:
> > Add an API to check whether there are pending used buffers. There is
> > already a similar API called virtqueue_poll() but it only works together
> > with virtqueue_enable_cb_prepare(). The patches that follow add blk-mq
> > ->poll() support to virtio_blk and they need to check for used buffers
> > without re-enabling virtqueue callbacks, so introduce an API for it.
> >
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
>
>
> Typo in the subject.
Thanks, will fix.
> > +/**
> > + * virtqueue_more_used - check if there are used buffers pending
> > + * @_vq: the struct virtqueue we're talking about.
> > + *
> > + * Returns true if there are used buffers, false otherwise. May be called at
> > + * the same time as other virtqueue operations, but actually calling
> > + * virtqueue_get_buf() requires serialization so be mindful of the race between
> > + * calling virtqueue_more_used() and virtqueue_get_buf().
> > + */
> > +bool virtqueue_more_used(const struct virtqueue *_vq)
> > +{
> > + struct vring_virtqueue *vq = to_vvq(_vq);
> > +
> > + return more_used(vq);
> > +}
> > +EXPORT_SYMBOL_GPL(virtqueue_more_used);
>
>
> It's worth to mention that the function is not serialized (no barriers).
Thanks, will fix.
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2021-05-25 8:48 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-20 14:13 [PATCH 0/3] virtio_blk: blk-mq io_poll support Stefan Hajnoczi
2021-05-20 14:13 ` [PATCH 1/3] virtio: add virtioqueue_more_used() Stefan Hajnoczi
2021-05-25 2:23 ` Jason Wang
2021-05-25 8:48 ` Stefan Hajnoczi [this message]
2021-05-20 14:13 ` [PATCH 2/3] virtio_blk: avoid repeating vblk->vqs[qid] Stefan Hajnoczi
2021-05-25 2:25 ` Jason Wang
2021-05-20 14:13 ` [PATCH 3/3] virtio_blk: implement blk_mq_ops->poll() Stefan Hajnoczi
2021-05-24 14:59 ` Christoph Hellwig
2021-05-25 7:22 ` Paolo Bonzini
2021-05-25 7:38 ` Ming Lei
2021-05-25 8:06 ` Paolo Bonzini
2021-05-25 13:20 ` Stefan Hajnoczi
2021-05-25 13:19 ` Stefan Hajnoczi
2021-05-25 3:21 ` Jason Wang
2021-05-25 8:59 ` Stefan Hajnoczi
2021-05-27 5:48 ` Jason Wang
2021-06-03 15:24 ` Stefan Hajnoczi
2021-05-27 2:44 ` Ming Lei
2021-06-03 15:12 ` Stefan Hajnoczi
2021-06-03 15:30 ` [PATCH 0/3] virtio_blk: blk-mq io_poll support Stefan Hajnoczi
2021-06-16 7:43 ` 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=YKy5zCoPpp8CDAOI@stefanha-x1.localdomain \
--to=stefanha@redhat.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=jasowang@redhat.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=sgarzare@redhat.com \
--cc=slp@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox