From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH] vhost: batch used descriptors chains write-back with packed ring Date: Wed, 19 Dec 2018 10:16:24 +0100 Message-ID: <003a5fbb-386f-2cf6-e83d-abd7b9fc2938@redhat.com> References: <20181212082403.12002-1-maxime.coquelin@redhat.com> <20181212134459-mutt-send-email-mst@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Ilya Maximets , dev@dpdk.org, tiwei.bie@intel.com, zhihong.wang@intel.com, jfreimann@redhat.com, Jason Wang To: "Michael S. Tsirkin" Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 3918A1B4FF for ; Wed, 19 Dec 2018 10:16:35 +0100 (CET) In-Reply-To: <20181212134459-mutt-send-email-mst@kernel.org> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 12/12/18 7:53 PM, Michael S. Tsirkin wrote: > On Wed, Dec 12, 2018 at 05:34:31PM +0100, Maxime Coquelin wrote: >> Hi Ilya, >> >> On 12/12/18 4:23 PM, Ilya Maximets wrote: >>> On 12.12.2018 11:24, Maxime Coquelin wrote: >>>> Instead of writing back descriptors chains in order, let's >>>> write the first chain flags last in order to improve batching. >>>> >>>> With Kernel's pktgen benchmark, ~3% performance gain is measured. >>>> >>>> Signed-off-by: Maxime Coquelin >>>> --- >>>> lib/librte_vhost/virtio_net.c | 39 +++++++++++++++++++++-------------- >>>> 1 file changed, 24 insertions(+), 15 deletions(-) >>>> >>> >>> Hi. >>> I made some rough testing on my ARMv8 system with this patch and v1 of it. >>> Here is the performance difference with current master: >>> v1: +1.1 % >>> v2: -3.6 % >>> >>> So, write barriers are quiet heavy in practice. >> >> Thanks for testing it on ARM. Indeed, SMP WMB is heavier on ARM. > > Besides your ideas for improving packed rings, maybe we should switch to > load_acquite/store_release? > > See > virtio: use smp_load_acquire/smp_store_release > > which worked fine but as I only tested on x86 did not result in any gains. > Thanks for the pointer. We'll look into it for v19.05, as -rc1 for v19.02 is planned for end of week, so it will be too late to introduce such changes. Regards, Maxime