From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758732AbdACNI7 (ORCPT ); Tue, 3 Jan 2017 08:08:59 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35358 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933935AbdACNId (ORCPT ); Tue, 3 Jan 2017 08:08:33 -0500 Date: Tue, 3 Jan 2017 13:08:30 +0000 From: Stefan Hajnoczi To: Jason Wang Cc: mst@redhat.com, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next V2 1/3] vhost: better detection of available buffers Message-ID: <20170103130830.GA14707@stefanha-x1.localdomain> References: <1482912571-3157-1-git-send-email-jasowang@redhat.com> <1482912571-3157-2-git-send-email-jasowang@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2oS5YaxWCcQjTEyO" Content-Disposition: inline In-Reply-To: <1482912571-3157-2-git-send-email-jasowang@redhat.com> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --2oS5YaxWCcQjTEyO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 28, 2016 at 04:09:29PM +0800, Jason Wang wrote: > This patch tries to do several tweaks on vhost_vq_avail_empty() for a > better performance: >=20 > - check cached avail index first which could avoid userspace memory acces= s. > - using unlikely() for the failure of userspace access > - check vq->last_avail_idx instead of cached avail index as the last > step. >=20 > This patch is need for batching supports which needs to peek whether > or not there's still available buffers in the ring. >=20 > Signed-off-by: Jason Wang > --- > drivers/vhost/vhost.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) Reviewed-by: Stefan Hajnoczi --2oS5YaxWCcQjTEyO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJYa6JOAAoJEJykq7OBq3PIDqIIALlfkoB88iYF8bb4Zf7u+uyA vtuy/uIAv4ENa2gPdr8aVH5vCGkbKN430AkZrXCkXFF/Im50I/59u0RJJ1B2EAOA tTr27am3shyGl03f8svSDlE3wtaWm/2oReWtLBWWNuyd8sz4S5TU+MJRD24vsiP+ h8nAbg7dmSavfIKbiKcJnn3XgZfxcrOp6I8aGstfhTI2szqYY3t2zomIcSr+l3fP OkTzsoC9GmWqQi43N0jHNjioh3gEaPNxMISJxqaJoP33hVk2NpK6w7hVFr9pEcgB y8sQ23con2Hdbxt3xx7vHi4LzCj0lH5QhuAz0b6TFQ3dyhWDTB06tQReE4IW1kQ= =3bfK -----END PGP SIGNATURE----- --2oS5YaxWCcQjTEyO--