Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1254364

Re: [PATCH net-next RFC 1/2] vhost: introduce vhost_has_work()

From Jason Wang <jasowang@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH net-next RFC 1/2] vhost: introduce vhost_has_work()
Date 2015-10-23 09:20 +0200
Message-ID <qmENQ-2IV-7@gated-at.bofh.it> (permalink)
References <qmgBQ-12w-7@gated-at.bofh.it> <qmjzI-5kR-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH net-next RFC 1/2] vhost: introduce vhost_has_work() Jason Wang <jasowang@redhat.com> - 2015-10-22 07:30 +0200
  [PATCH net-next RFC 2/2] vhost_net: basic polling support Jason Wang <jasowang@redhat.com> - 2015-10-22 07:30 +0200
    Re: [PATCH net-next RFC 2/2] vhost_net: basic polling support "Michael S. Tsirkin" <mst@redhat.com> - 2015-10-22 11:40 +0200
      Re: [PATCH net-next RFC 2/2] vhost_net: basic polling support Rick Jones <rick.jones2@hpe.com> - 2015-10-22 17:50 +0200
        Re: [PATCH net-next RFC 2/2] vhost_net: basic polling support "Michael S. Tsirkin" <mst@redhat.com> - 2015-10-22 18:20 +0200
          Re: [PATCH net-next RFC 2/2] vhost_net: basic polling support Jason Wang <jasowang@redhat.com> - 2015-10-23 09:20 +0200
      Re: [PATCH net-next RFC 2/2] vhost_net: basic polling support Jason Wang <jasowang@redhat.com> - 2015-10-23 09:20 +0200
        Re: [PATCH net-next RFC 2/2] vhost_net: basic polling support "Michael S. Tsirkin" <mst@redhat.com> - 2015-10-23 15:40 +0200
  Re: [PATCH net-next RFC 1/2] vhost: introduce vhost_has_work() "Michael S. Tsirkin" <mst@redhat.com> - 2015-10-22 10:40 +0200
    Re: [PATCH net-next RFC 1/2] vhost: introduce vhost_has_work() Jason Wang <jasowang@redhat.com> - 2015-10-23 09:20 +0200

csiph-web