From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id EDDA623B for ; Wed, 20 Sep 2017 08:57:37 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2017 23:57:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,420,1500966000"; d="scan'208";a="902114418" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by FMSMGA003.fm.intel.com with ESMTP; 19 Sep 2017 23:57:36 -0700 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 19 Sep 2017 23:57:35 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 19 Sep 2017 23:57:35 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.159]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.152]) with mapi id 14.03.0319.002; Wed, 20 Sep 2017 14:57:33 +0800 From: "Li, Xiaoyun" To: "Wang, Liang-min" , "Richardson, Bruce" , "Ananyev, Konstantin" CC: "Zhang, Qi Z" , "Lu, Wenzhuo" , "Zhang, Helin" , "pierre@emutex.com" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2 1/3] eal/x86: run-time dispatch over memcpy Thread-Index: AQHTIwBrlGsHmgShskuUmMa7Bb4+wKKfOegAgACHy9D//484AIAEpU8AgAORwkCAABh6cIAAALbwgAKbI7CABkpjcIAM3zog Date: Wed, 20 Sep 2017 06:57:33 +0000 Message-ID: References: <1503626773-184682-1-git-send-email-xiaoyun.li@intel.com> <1504256222-32969-1-git-send-email-xiaoyun.li@intel.com> <1504256222-32969-2-git-send-email-xiaoyun.li@intel.com> <2601191342CEEE43887BDE71AB9772584F23F1AC@IRSMSX103.ger.corp.intel.com> <2601191342CEEE43887BDE71AB9772584F23F281@IRSMSX103.ger.corp.intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDUwMGEyZmItZWMxZC00MDViLWE3OTgtYTEwMDhiNzkyMmYyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImtxRHZJXC9oZW5weGx1dUNqeTZaZjhMOHd0aU53TTlRNkJFcXd2THJQYW5ZPSJ9 x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 1/3] eal/x86: run-time dispatch over memcpy X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Sep 2017 06:57:38 -0000 Hi all After further investigating, we have found some benefits with the patchset. So the plan is to add a config parameter CONFIG_RTE_ENABLE_RUNTIME_DISPATCH= . By default, the value is "n" and would use current memcpy codes. Only if users config it to "y", it would use the run-time dispatch codes(wi= thout inline). Best Regards, Xiaoyun Li > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Li, Xiaoyun > Sent: Tuesday, September 12, 2017 10:27 > To: Wang, Liang-min ; Richardson, Bruce > ; Ananyev, Konstantin > > Cc: Zhang, Qi Z ; Lu, Wenzhuo > ; Zhang, Helin ; > pierre@emutex.com; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v2 1/3] eal/x86: run-time dispatch over > memcpy >=20 > Hi ALL >=20 > After investigating, most DPDK codes are already run-time dispatching. On= ly > rte_memcpy chooses the ISA at build-time. >=20 > To modify memcpy, there are two ways. The first one is function pointers > and another is function multi-versioning in GCC. >=20 > But memcpy has been greatly optimized and gets benefit from total inline.= If > changing it to run-time dispatching via function pointers, the perf will = drop a > lot especially when copy size is small. >=20 > And function multi-versioning in GCC only works for C++. Even if it is sa= id that > GCC6 can support C, but in fact it does not support C in my trial. >=20 >=20 >=20 > The attachment is the perf results of memcpy with and without my patch an= d > original DPDK codes but without inline. >=20 > It's just for comparison, so right now, I only tested on Broadwell, using= AVX2. >=20 > The results are from running test/test/test_memcpy_perf.c. >=20 > (C =3D compile-time constant) >=20 > /* Do aligned tests where size is a variable */ >=20 > /* Do aligned tests where size is a compile-time constant */ >=20 > /* Do unaligned tests where size is a variable */ >=20 > /* Do unaligned tests where size is a compile-time constant */ >=20 >=20 >=20 > 4-7 means dpdk costs time 4 and glibc costs time 7 >=20 > For size smaller than 128 bytes. This patch's perf is bad and even worse = than > glibc. >=20 > When size grows, the perf is better than glibc but worse than original dp= dk. >=20 > And when grows above about 1024 bytes, it performs similarly to original > dpdk. >=20 > Furthermore, if delete inline in original dpdk, the perf are similar to t= he perf > with patch. >=20 > Different situations(4 types, such as cache to cache) perform differently= but > the trend is the same (size grows, perf grows). >=20 >=20 >=20 > So if needs dynamic, needs sacrifices some perf and needs to compile for = the > minimum target (e.g. compile for target avx, run on avx, avx2, avx512f). >=20 >=20 >=20 > Thus, I think this feature shouldn't be delivered in this release. >=20 >=20 >=20 > Best Regards, >=20 > Xiaoyun Li