From: Jason Wang <jasowang@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kvm@vger.kernel.org, virtualization@lists.linux-foundation.org
Subject: Re: [PATCH net-next RFC 1/2] vhost: introduce vhost_has_work()
Date: Fri, 23 Oct 2015 15:10:44 +0800 [thread overview]
Message-ID: <5629DD74.1090702@redhat.com> (raw)
In-Reply-To: <20151022113740-mutt-send-email-mst@redhat.com>
On 10/22/2015 04:38 PM, Michael S. Tsirkin wrote:
> On Thu, Oct 22, 2015 at 01:27:28AM -0400, Jason Wang wrote:
>> > This path introduces a helper which can give a hint for whether or not
>> > there's a work queued in the work list.
>> >
>> > Signed-off-by: Jason Wang <jasowang@redhat.com>
>> > ---
>> > drivers/vhost/vhost.c | 6 ++++++
>> > drivers/vhost/vhost.h | 1 +
>> > 2 files changed, 7 insertions(+)
>> >
>> > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
>> > index eec2f11..d42d11e 100644
>> > --- a/drivers/vhost/vhost.c
>> > +++ b/drivers/vhost/vhost.c
>> > @@ -245,6 +245,12 @@ void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work)
>> > }
>> > EXPORT_SYMBOL_GPL(vhost_work_queue);
>> >
>> > +bool vhost_has_work(struct vhost_dev *dev)
>> > +{
>> > + return !list_empty(&dev->work_list);
>> > +}
>> > +EXPORT_SYMBOL_GPL(vhost_has_work);
>> > +
>> > void vhost_poll_queue(struct vhost_poll *poll)
>> > {
>> > vhost_work_queue(poll->dev, &poll->work);
> This doesn't take a lock so it's unreliable.
> I think it's ok in this case since it's just
> an optimization - but pls document this.
>
Ok, will do.
prev parent reply other threads:[~2015-10-23 7:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-22 5:27 [PATCH net-next RFC 1/2] vhost: introduce vhost_has_work() Jason Wang
2015-10-22 5:27 ` [PATCH net-next RFC 2/2] vhost_net: basic polling support Jason Wang
2015-10-22 9:33 ` Michael S. Tsirkin
2015-10-22 15:46 ` Rick Jones
[not found] ` <562904D9.9080109@hpe.com>
2015-10-22 16:16 ` Michael S. Tsirkin
[not found] ` <20151022191456-mutt-send-email-mst@redhat.com>
2015-10-23 7:14 ` Jason Wang
2015-10-23 7:13 ` Jason Wang
[not found] ` <5629DE03.7030902@redhat.com>
2015-10-23 13:39 ` Michael S. Tsirkin
2015-10-22 8:38 ` [PATCH net-next RFC 1/2] vhost: introduce vhost_has_work() Michael S. Tsirkin
2015-10-23 7:10 ` Jason Wang [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=5629DD74.1090702@redhat.com \
--to=jasowang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).