From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id E5E8BF983; Mon, 27 Mar 2017 09:34:22 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0D74568E0B; Mon, 27 Mar 2017 07:34:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0D74568E0B Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=maxime.coquelin@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0D74568E0B Received: from [10.36.112.27] (ovpn-112-27.ams2.redhat.com [10.36.112.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EB719857A8; Mon, 27 Mar 2017 07:34:20 +0000 (UTC) To: Kevin Traynor , yuanhan.liu@linux.intel.com References: <1489605049-18686-1-git-send-email-ktraynor@redhat.com> <1490283898-23019-1-git-send-email-ktraynor@redhat.com> Cc: dev@dpdk.org, stable@dpdk.org From: Maxime Coquelin Message-ID: Date: Mon, 27 Mar 2017 09:34:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1490283898-23019-1-git-send-email-ktraynor@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 27 Mar 2017 07:34:22 +0000 (UTC) Subject: Re: [dpdk-stable] [PATCH v2] vhost: fix virtio_net false sharing X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 07:34:23 -0000 On 03/23/2017 04:44 PM, Kevin Traynor wrote: > The broadcast_rarp field in the virtio_net struct is checked in the > dequeue datapath regardless of whether descriptors are available or not. > > As it is checked with cmpset leading to a write, false sharing on the > virtio_net struct can happen between enqueue and dequeue datapaths > regardless of whether a RARP is requested. In OVS, the issue can cause > a uni-directional performance drop of up to 15%. > > Fix that by only performing the cmpset if a read of broadcast_rarp > indicates that the cmpset is likely to succeed. > > Fixes: a66bcad32240 ("vhost: arrange struct fields for better cache sharing") > Cc: stable@dpdk.org > > Signed-off-by: Kevin Traynor > --- > > V2: > Change from fixing by moving broadcast_rarp location in virtio_net struct > to performing a read before cmpset. > > lib/librte_vhost/virtio_net.c | 16 ++++++++++++++-- > 1 file changed, 14 insertions(+), 2 deletions(-) Nice! Reviewed-by: Maxime Coquelin I'll try to benchmark it with testpmd only to see if we measure the same gain without OVS. Thanks, Maxime