From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2A64B440F2; Tue, 28 May 2024 10:27:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EB67840693; Tue, 28 May 2024 10:27:21 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id 52B874068E for ; Tue, 28 May 2024 10:27:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716884841; x=1748420841; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=8p7PWzuf25CcLIDCo4WT4oIs1QOnEg4mOOiJ0BMkpOE=; b=RZCRnN5/9o8Oql+e3anCIfHVDMMEA2NITsvMgtmf9h4ZwR9Ralu2vOzJ 9dxc8htnVwNmLIPSra2Ww2cMP+BNQ5dHWWukzaTEeWkn0EA8SOGllqy2o 1/LJXoSyEYxgPmQLqP/9QtVZuKJucTsBoJSCc5eNwpFAot4azzSDaYrUB NRrRLN9z8ut6xkejT5koNAG4XRB6XIMcnGPMh5y8oF1stcohLiRqqd0Y8 Mtoaou1mSMa+qB8koTASVmEPnOjbxCA93ohVGYFVcLORHn/i3vcxwdmbE 5Vvrrp3TWqGwrQrRZoSlQqUqkZQraaRZgE2YVo28+/j58RwHme0fZzvrd A==; X-CSE-ConnectionGUID: WrawId8HQ5KZ+wOoNTKTuQ== X-CSE-MsgGUID: yohYzh2PRtmMp6bw/Dw8gA== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="24628269" X-IronPort-AV: E=Sophos;i="6.08,194,1712646000"; d="scan'208";a="24628269" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2024 01:27:20 -0700 X-CSE-ConnectionGUID: i6nAMXMAQvmLrxoaYzH07A== X-CSE-MsgGUID: l9ZwjfmATpaeBt6Wk0F8WA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,194,1712646000"; d="scan'208";a="58176881" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa002.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 28 May 2024 01:27:19 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 28 May 2024 01:27:18 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Tue, 28 May 2024 01:27:18 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.172) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 28 May 2024 01:27:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hz1Ll2wTo5O0KUj9N2GekUbwYf7mshZIxC4om16VlSdb0GGm64hX+pmX3RccW0Zak6PmvUnrktnjNF4koeFvSTnY43BwiqFM2WebIIvnKMh/6TqgqE6TgYG0btJfBU5Iq2h/vi+rQhDK+MbEdpxr/EsBpydE+S4wfQzi7ci3eksT7WUxCX0XWELkcS205e8clsbrREPLmySwtgyccJJZVeIoD9cU1n1vLMYGuBU8aZ2IPRqPImwVpgJYVADKBrWpmAMAqrgMCyOvirTlR7B/RDRDEtNr8Wcctd7rViZ1uR62ofy7/OGYLLUwAMcJJDXIfzrO8yztNpHj9BCbLucVZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dJqHvFkYJzyb/DLu1zdTWk6a2bFaoRFloo+UwPfNVhQ=; b=k4TwH57MJmWY2Di/nhpifxkZCEaPvbXU0E8fzV/5ULaM7p7TYoc8oP+jR0FTiDqyknwlS6uycljnIUIc1KReb66osjQjONXG/igFuABau1kI1qtTFocNMzNmE6DWL20OgaCxkIOfwxGYdOpMYoWpS06M/A6HuDoxFOww+31E2v5bBWofzteXV2ivp+V/COOYZTCBBOazPGE6C0746/OUG93SSIMrCYdvXnwi3J7B/S28MdHJhD2ztYnca/x7WqLGH+78UoO3XJNuLg7lEIR2c7bojm3CQEemlFhgxvfK2/KcNl+igvIZwUqNRUCnWd34XBRiV/Urk0Gon2RbdN/YfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by CY8PR11MB7395.namprd11.prod.outlook.com (2603:10b6:930:86::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 08:27:16 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b%6]) with mapi id 15.20.7611.025; Tue, 28 May 2024 08:27:16 +0000 Date: Tue, 28 May 2024 09:27:12 +0100 From: Bruce Richardson To: Mattias =?iso-8859-1?Q?R=F6nnblom?= CC: Mattias =?iso-8859-1?Q?R=F6nnblom?= , , Morten =?iso-8859-1?Q?Br=F8rup?= , Stephen Hemminger Subject: Re: [RFC v2] eal: provide option to use compiler memcpy instead of RTE Message-ID: References: <20240527111151.188607-1-mattias.ronnblom@ericsson.com> <20240528074354.190779-1-mattias.ronnblom@ericsson.com> <738e376c-c5b6-44dc-ad51-00f40d2ea6b5@lysator.liu.se> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <738e376c-c5b6-44dc-ad51-00f40d2ea6b5@lysator.liu.se> X-ClientProxiedBy: DUZPR01CA0157.eurprd01.prod.exchangelabs.com (2603:10a6:10:4bd::21) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|CY8PR11MB7395:EE_ X-MS-Office365-Filtering-Correlation-Id: 347c9996-5f7c-4db9-9892-08dc7eeffb5d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|376005; X-Microsoft-Antispam-Message-Info: =?iso-8859-1?Q?43xERJn9fYS6Ut6wVz8/dhkBN5+++LM1NX85wgCH1bTnMBMZI82O1cFT5Y?= =?iso-8859-1?Q?PfdMvALf8PIBNqpS5HlH0YYqEWhIhXPxRLcquNBGrXmvcpP4KTndhZ34AO?= =?iso-8859-1?Q?oIQp3l2BE1URCVijM/bGGL5lVBieROo+7PV9tOwm7EHeIw/3xdtHB7xRkw?= =?iso-8859-1?Q?HBgIx2OpWFjnQRzkz+t/haIyeQT79PVYIFXLWHIl2b5vdscMohjLok4E5q?= =?iso-8859-1?Q?pH8ymIvxS4QjcK+h3sybqXp5hvFzTNP31cMxPZ80hC7I55J96SKv8Z+SQS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o9LdB0PM1EvhwBRpgQluxAwtskgIXxs4D9LkJvIA4X9bIGEj?= =?iso-8859-1?Q?aPx1MtV2sjG1rVJFdTACdnehSgfdoxVtJeieXnroLeosHz+L4Pv5ThqJdG?= =?iso-8859-1?Q?pzH3ZbY7V7vI5gyoC3xpfYQ+r++Y/RqLRHObLgeZy25lT/eUpIXBVNKcx/?= =?iso-8859-1?Q?W4s7orCqxoLFnekOa2WqLSfmDA=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366007)(1800799015)(376005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?SJ6G0WqSnSSnifv8xZIApbO/YfTN2/etAhZDQ73Hw/kgqn21jxPaHc5/ZN?= =?iso-8859-1?Q?4RoNfKSH457kcL7QB+saVyNQslrVWvia+yEmsONCWxShPbOnVrJqFxL0nq?= =?iso-8859-1?Q?RRCjcpn1YMSJJmEN7sgTNOpFXl5sEYknN1lBXsf0bYJ28iw2Fccp97WIoA?= =?iso-8859-1?Q?G5QyHYX95A6C5qvm2LEQXAiBv18EHi0zDtdL4UY2v3u/Ex1MzwCTB+NSiW?= =?iso-8859-1?Q?l1hyjh1oNjhkPhgrWndO7dlO/jzgt23PTtOZPVEzlCXWb9nMw5icleH8t4?= =?iso-8859-1?Q?85U5x4m9kl0mB7oH0FVJgt/gJUfmHncrQNHTUMHQg6Ld05CuTliTQbk8Px?= =?iso-8859-1?Q?xQbYtYCT1D98tPVmsq8yEhZ55nsSNsV5jl8tp01qnwhdY+gmz0W+Ty9WfI?= =?iso-8859-1?Q?QswVo4UdcgFGdbWlwYFwZyXOzxx9H5TIU5WYWXnv4uHcQrkCMH1AcJYse5?= =?iso-8859-1?Q?0SAuHR3n1ht2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so-8859-1?Q?8HuN7WyEgQE9FlTtPJr5zBKDUaKCdPoclzpEZQ5zYa6zC+0uwzS50g8SrW?= =?iso-8859-1?Q?u/hKfF1DpEX7Yn0wC8ZF7E17l+iwT/8kcfjgMa7+AipejbsFQHWZXt+kYT?= =?iso-8859-1?Q?TQpOehtLBUL94beLVTN5TzwcjG9wo3TtJk3umopD4UQ1wp8BxZLtgniDdp?= =?iso-8859-1?Q?J2GRm6q7MWzxuuuzFhpY/OMBWGc8I9yvZcpnw9tpRyLYBi19M3weOYfUaJ?= =?iso-8859-1?Q?dYC9bngTeoA0P6XXKgP9/1RZVgM7hoynWZqFQ644CBmBoCqYmQKgJmpQ?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 347c9996-5f7c-4db9-9892-08dc7eeffb5d X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 08:27:16.0174 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Ox0KSA7f4I+OLLl3nvqyRHjc7HWF5HBz2POmT26d/uDSW8OMTdM30I1Y9tPBYJFS14oNUiTFMVU98AeZpytFd6L6LU5N0tSXrTYSGOW1PVM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB7395 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, May 28, 2024 at 10:19:15AM +0200, Mattias Rönnblom wrote: > On 2024-05-28 09:43, Mattias Rönnblom wrote: > > Provide build option to have functions in delegate to > > the standard compiler/libc memcpy(), instead of using the various > > traditional, handcrafted, per-architecture rte_memcpy() > > implementations. > > > > A new meson build option 'use_cc_memcpy' is added. The default is > > true. It's not obvious what should be the default, but compiler > > memcpy() is enabled by default in this RFC so any tests run with this > > patch use the new approach. > > > > One purpose of this RFC is to make it easy to evaluate the costs and > > benefits of a switch. > > > > I've tested this patch some with DSW micro benchmarks, and the result is a > 2.5% reduction of the DSW+testapp overhead with cc/libc memcpy. GCC 11.4. > > We've also run characteristic test suite of a large, real world app. Here, > we saw no effect. GCC 10.5. > > x86_64 in both cases (Skylake and Raptor Lake). > > Last time we did the same, there were a noticeable performance degradation > in both the above cases. > > This is not a lot of data points, but I think it we should consider making > the custom RTE memcpy() implementations optional in the next release, and if > no-one complains, remove the implementations in the next release. > > (Whether or not [or how long] to keep the wrapper API is another question.) > > The other instance I've heard mention of in the past is virtio/vhost, which used to have a speedup from the custom memcpy. My own thinking on these cases, is that for targetted settings like these, we should look to have local memcpy functions written - taking account of the specifics of each usecase. For virtio/vhost for example, we can have assumptions around host buffer alignment, and we also can be pretty confident we are copying to another CPU. For DSW, or other eventdev cases, we would only be looking at copies of multiples of 16, with guaranteed 8-byte alignment on both source and destination. Writing efficient copy fns for specific scenarios can be faster and more effective than trying to write a general, optimized in all cases, memcpy. It also discourages the use of non-libc memcpy except where really necessary. Naturally, if we find there are a lot of cases where use of libc memcpy slows us down, we will want to keep a general rte_memcpy. However, I'd hope the slowdown cases are very few. /Bruce