Re: [PATCH net-next V2 1/3] vhost: better detection of available buffers
From: Stefan Hajnoczi <hidden>
Date: 2017-01-03 13:08:59
Also in:
kvm, lkml, netdev
From: Stefan Hajnoczi <hidden>
Date: 2017-01-03 13:08:59
Also in:
kvm, lkml, netdev
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: - check cached avail index first which could avoid userspace memory access. - using unlikely() for the failure of userspace access - check vq->last_avail_idx instead of cached avail index as the last step. This patch is need for batching supports which needs to peek whether or not there's still available buffers in the ring. Signed-off-by: Jason Wang <jasowang@redhat.com> --- drivers/vhost/vhost.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>