Received: from eggs.gnu.org ([2001:4830:134:3::10]:46290) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLZ1R-0005kg-4D for qemu-devel@nongnu.org; Tue, 19 Jan 2016 11:20:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLZ1M-00055a-VC for qemu-devel@nongnu.org; Tue, 19 Jan 2016 11:20:44 -0500 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:37834) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLZ1M-00055G-Lz for qemu-devel@nongnu.org; Tue, 19 Jan 2016 11:20:40 -0500 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 19 Jan 2016 16:20:39 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 840AF1B08067 for ; Tue, 19 Jan 2016 16:20:41 +0000 (GMT) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u0JGKbI110879406 for ; Tue, 19 Jan 2016 16:20:37 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u0JGKak2020391 for ; Tue, 19 Jan 2016 09:20:36 -0700 Date: Tue, 19 Jan 2016 17:20:34 +0100 From: Cornelia Huck Message-ID: <20160119172034.7715d355.cornelia.huck@de.ibm.com> In-Reply-To: <1452861718-25806-10-git-send-email-pbonzini@redhat.com> References: <1452861718-25806-1-git-send-email-pbonzini@redhat.com> <1452861718-25806-10-git-send-email-pbonzini@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 09/10] virtio: read avail_idx from VQ only when necessary List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, Vincenzo Maffione , mst@redhat.com On Fri, 15 Jan 2016 13:41:57 +0100 Paolo Bonzini wrote: > From: Vincenzo Maffione > > The virtqueue_pop() implementation needs to check if the avail ring > contains some pending buffers. To perform this check, it is not > always necessary to fetch the avail_idx in the VQ memory, which is > expensive. This patch introduces a shadow variable tracking avail_idx > and modifies virtio_queue_empty() to access avail_idx in physical > memory only when necessary. > > Signed-off-by: Vincenzo Maffione > Message-Id: > Signed-off-by: Paolo Bonzini > --- > hw/virtio/virtio.c | 25 +++++++++++++++++++++---- > 1 file changed, 21 insertions(+), 4 deletions(-) Reviewed-by: Cornelia Huck