From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id A29115686 for ; Mon, 10 Oct 2016 06:16:29 +0200 (CEST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP; 09 Oct 2016 21:16:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,470,1473145200"; d="scan'208";a="17904589" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga005.fm.intel.com with ESMTP; 09 Oct 2016 21:16:22 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 9 Oct 2016 21:16:22 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.234]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.95]) with mapi id 14.03.0248.002; Mon, 10 Oct 2016 12:16:20 +0800 From: "Wang, Zhihong" To: Yuanhan Liu , "Michael S. Tsirkin" CC: Maxime Coquelin , Stephen Hemminger , "dev@dpdk.org" , "qemu-devel@nongnu.org" Thread-Topic: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature Thread-Index: AQHSIqeUMdxCxuWNIEy4GQkXcpemR6CghmoAgAADeQCAAIbDIA== Date: Mon, 10 Oct 2016 04:16:19 +0000 Message-ID: <8F6C2BD409508844A0EFC19955BE09414E7BC050@SHSMSX103.ccr.corp.intel.com> References: <20160926221112-mutt-send-email-mst@kernel.org> <20160927031158.GA25823@yliu-dev.sh.intel.com> <20160927224935-mutt-send-email-mst@kernel.org> <20160928022848.GE1597@yliu-dev.sh.intel.com> <20160929205047-mutt-send-email-mst@kernel.org> <2889e609-f750-a4e1-66f8-768bb07a2339@redhat.com> <20160929231252-mutt-send-email-mst@kernel.org> <20161010033744.GW1597@yliu-dev.sh.intel.com> <20161010064113-mutt-send-email-mst@kernel.org> <20161010035910.GY1597@yliu-dev.sh.intel.com> In-Reply-To: <20161010035910.GY1597@yliu-dev.sh.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 04:16:30 -0000 > -----Original Message----- > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > Sent: Monday, October 10, 2016 11:59 AM > To: Michael S. Tsirkin > Cc: Maxime Coquelin ; Stephen Hemminger > ; dev@dpdk.org; qemu- > devel@nongnu.org; Wang, Zhihong > Subject: Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature >=20 > On Mon, Oct 10, 2016 at 06:46:44AM +0300, Michael S. Tsirkin wrote: > > On Mon, Oct 10, 2016 at 11:37:44AM +0800, Yuanhan Liu wrote: > > > On Thu, Sep 29, 2016 at 11:21:48PM +0300, Michael S. Tsirkin wrote: > > > > On Thu, Sep 29, 2016 at 10:05:22PM +0200, Maxime Coquelin wrote: > > > > > > > > > > > > > > > On 09/29/2016 07:57 PM, Michael S. Tsirkin wrote: > > > > Yes but two points. > > > > > > > > 1. why is this memset expensive? > > > > > > I don't have the exact answer, but just some rough thoughts: > > > > > > It's an external clib function: there is a call stack and the > > > IP register will bounch back and forth. > > > > for memset 0? gcc 5.3.1 on fedora happily inlines it. >=20 > Good to know! >=20 > > > overkill to use that for resetting 14 bytes structure. > > > > > > Some trick like > > > *(struct virtio_net_hdr *)hdr =3D {0, }; > > > > > > Or even > > > hdr->xxx =3D 0; > > > hdr->yyy =3D 0; > > > > > > should behaviour better. > > > > > > There was an example: the vhost enqueue optmization patchset from > > > Zhihong [0] uses memset, and it introduces more than 15% drop (IIRC) > > > on my Ivybridge server: it has no such issue on his server though. > > > > > > [0]: http://dpdk.org/ml/archives/dev/2016-August/045272.html > > > > > > --yliu > > > > I'd say that's weird. what's your config? any chance you > > are using an old compiler? >=20 > Not really, it's gcc 5.3.1. Maybe Zhihong could explain more. IIRC, > he said the memset is not well optimized for Ivybridge server. The dst is remote in that case. It's fine on Haswell but has complication in Ivy Bridge which (wasn't supposed to but) causes serious frontend issue. I don't think gcc inlined it there. I'm using fc24 gcc 6.1.1. >=20 > --yliu