Received: from eggs.gnu.org ([2001:4830:134:3::10]:37878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRHJI-0002hj-RO for qemu-devel@nongnu.org; Fri, 27 Feb 2015 04:34:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YRHJF-0000SH-MR for qemu-devel@nongnu.org; Fri, 27 Feb 2015 04:34:16 -0500 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:34459) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRHJF-0000S2-EZ for qemu-devel@nongnu.org; Fri, 27 Feb 2015 04:34:13 -0500 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 27 Feb 2015 09:34:11 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 3317717D8056 for ; Fri, 27 Feb 2015 09:34:25 +0000 (GMT) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t1R9Y78n10813776 for ; Fri, 27 Feb 2015 09:34:07 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t1R9Y7eq004861 for ; Fri, 27 Feb 2015 02:34:07 -0700 Date: Fri, 27 Feb 2015 10:34:05 +0100 From: Cornelia Huck Message-ID: <20150227103405.604900cf.cornelia.huck@de.ibm.com> In-Reply-To: <1425008040.3834.4@smtp.corp.redhat.com> References: <1424934286-7099-1-git-send-email-jasowang@redhat.com> <1424934286-7099-4-git-send-email-jasowang@redhat.com> <20150226135717.3f5b5789.cornelia.huck@de.ibm.com> <1425008040.3834.4@smtp.corp.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V2 03/11] virito: introduce bus specific queue limit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang Cc: mst@redhat.com, Alexander Graf , qemu-devel@nongnu.org, Christian Borntraeger , Anthony Liguori , Paolo Bonzini , Richard Henderson On Fri, 27 Feb 2015 03:42:00 +0008 Jason Wang wrote: > On Thu, Feb 26, 2015 at 8:57 PM, Cornelia Huck > wrote: > > On Thu, 26 Feb 2015 15:04:38 +0800 > > Jason Wang wrote: > > > >> This patch introduces a bus specific queue limitation. It will be > >> useful for increasing the limit for one of the bus without > >> disturbing > >> other buses. > >> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c > >> index ffc22e8..5a806b5 100644 > >> --- a/hw/virtio/virtio.c > >> +++ b/hw/virtio/virtio.c > >> @@ -541,6 +541,14 @@ void virtio_update_irq(VirtIODevice *vdev) > >> virtio_notify_vector(vdev, VIRTIO_NO_VECTOR); > >> } > >> > >> +int virtio_get_queue_max(VirtIODevice *vdev) > >> +{ > >> + BusState *qbus = qdev_get_parent_bus(DEVICE(vdev)); > >> + VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus); > >> + > >> + return k->queue_max; > >> +} > >> + > > > > Are all callers of this in the slow path? So we don't introduce > > processing overhead. > > Looks not. For overhead, do you mean one introduced by > VIRTIO_BUS_GET_CLASS()? Not sure how much it will affact but we've > already used something like this in the datapath, e.g > virtio_notify_vector(). I may have misremembered how much overhead those types of operation introduce. But it made me think: This function is basically introducing a per-VirtIODevice queue limit. We set it once in the VirtioBusClass during initialization, but don't expect it to change. Why don't we just propagate it to a new member of VirtIODevice during initialization instead?