From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUlI6-0002Qo-1d for qemu-devel@nongnu.org; Tue, 02 Aug 2016 21:48:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUlI2-0007Jy-U9 for qemu-devel@nongnu.org; Tue, 02 Aug 2016 21:48:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42932) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUlI2-0007Ji-OD for qemu-devel@nongnu.org; Tue, 02 Aug 2016 21:48:10 -0400 References: <1470038878-5599-1-git-send-email-jasowang@redhat.com> <20160801200029.30da2f30.cornelia.huck@de.ibm.com> <633c8858-ea7d-0ed1-538f-e6c4eaf160c6@redhat.com> <20160802083713.10f06635.cornelia.huck@de.ibm.com> From: Jason Wang Message-ID: <99fc5bcd-e504-ce61-c17d-3b5da6bcb636@redhat.com> Date: Wed, 3 Aug 2016 09:48:01 +0800 MIME-Version: 1.0 In-Reply-To: <20160802083713.10f06635.cornelia.huck@de.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] vhost: don't set vring call if no vector List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck Cc: qemu-devel@nongnu.org, mst@redhat.com On 2016=E5=B9=B408=E6=9C=8802=E6=97=A5 14:37, Cornelia Huck wrote: > On Tue, 2 Aug 2016 10:39:22 +0800 > Jason Wang wrote: > >> On 2016=E5=B9=B408=E6=9C=8802=E6=97=A5 02:00, Cornelia Huck wrote: >>> On Mon, 1 Aug 2016 16:07:58 +0800 >>> Jason Wang wrote: >>>> + if (k->query_guest_notifiers && >>>> + k->query_guest_notifiers(qbus->parent) && >>>> + virtio_queue_vector(vdev, idx) =3D=3D VIRTIO_NO_VECTOR) { >>> I'm trying to imagine what this means for virtio-ccw. Keep in mind th= at >>> we don't have the concept of setting a 'vector' by the OS (the vector >>> is setup internally to the queue index and the OS does not see it.) >>> >>> ->query_guest_notifiers() is true if the OS has enabled the subchanne= l >>> of the proxy device (i.e., if it is enabled for doing *anything* with >>> the subchannel, regardless whether the OS wants to be notified or is >>> planning to poll.) The second condition will never hold true for any >>> valid queue once the OS has setup the queues. >> I see, so If I understand correctly, there's no way to detect whether = or >> not guest will use a specific virtqueue interrupt? > Yes. The guest will either be notified for any virtqueue (if it > registered indicators; this is always done for every vq of the device > at once), or for none. > >>> So this won't break anything for virtio-ccw AFAICS, but I don't think >>> we gain anything. >> Yes, but if we could infer whether or not polling is used in the drive= r, >> this is probably all we can do for ccw. > What we could do is check whether the driver has registed indicators > and disable setting up notification for any vq of the device if not. > But I'm not sure an always-polling driver is worth optimizing for. It's worth for at least pci transport. Consider virito-net pmd in guest,=20 a NULL vring call can save unnecessary userspace memory access and=20 memory barriers.