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 91458A0093; Mon, 7 Nov 2022 10:19:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8609040156; Mon, 7 Nov 2022 10:19:20 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id A0E4C40151 for ; Mon, 7 Nov 2022 10:19:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667812758; x=1699348758; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=Nfw7GqJZAtO3W2Wx/r0riKCLQY0xfQ1r5L/J7o6lmXI=; b=lIcd653Uv+9kFEw9U3gx2FUZmGkuKW8YNi/yZqB33tYraiS9nom4pp10 NiX/OkHMGFw4u6uN3ZCgFahK7q81wBZubM8Cxx8f7fW3OoGwvFNcuq1yX nD5McuBT8L9+u/a6NqhMQvOudmCizeNWaraqaAO6DOWG6rn7ByhJSY/Ed xQ/OsPZrzDb+gZY0hDwST+8GFgpbj0MeNYUUF5GEivCL9dxVdFky4Zrhv M9aodDzynu4FgMA5UP5uN9DTz4r8k0pXFzIkFA7eCa2R2aa1DT8qgbZsR BS5OlAGU6N6IPpaJ7l9WYld/blN3ke4Zrj6BDBf2TZACIU4j8B2LDvNmI w==; X-IronPort-AV: E=McAfee;i="6500,9779,10523"; a="311501478" X-IronPort-AV: E=Sophos;i="5.96,143,1665471600"; d="scan'208";a="311501478" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 01:19:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10523"; a="586904421" X-IronPort-AV: E=Sophos;i="5.96,143,1665471600"; d="scan'208";a="586904421" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga003.jf.intel.com with ESMTP; 07 Nov 2022 01:19:17 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 7 Nov 2022 01:19:17 -0800 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 7 Nov 2022 01:19:17 -0800 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.2375.31 via Frontend Transport; Mon, 7 Nov 2022 01:19:17 -0800 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.40) 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.2375.31; Mon, 7 Nov 2022 01:19:16 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lWpJNe1TAu4PV+nNgLw3rF3vMhTwlXx+Dh1MIk4nY1xzMxzStsTD3ue3NtcCfsZPgB9R21sCahaawTKTYabLv0KH7DMY8hCbYRg0ZN78ozq8QnNP1kv25+9JyO12cz/TnFip+i6sZ9Z/8zW3z0Uoa41C+ImXxORLeuVe/sQIsfMpcAETBVc9ofgm5RiCxPGk7U7ZhElayY5FUy8IJX0Ug0ji51iq32In7oE+VQI2/Lxu62rmytZLdY1Y/y16KYfiWlFiBIf1iodBaiJNr9KtCuR5DkF5l/ce32iSsTg8CcWUdJ9D+UM5pu0RPNs6XU6oJPEpWNnuXeQ+zDGLj+VyVg== 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=xWA88QMIBVTZqBvzJyA/3tT5hu1m4mTB41jtYVh04rA=; b=Tm5B2YQUsxSlE28X69FRtuuXpmZ1jAcqU+BFYtPaWsX8YbbnAGcJJUoQHRgHHFZs8flhAIIdBPZ7L4uD+gMZ4AHwkSLkUt5XhmmU685M1mvrcagBOGmgEaJ2G16nvn2cCOIFtyBNzlpFN3Uzh5j9A7kZHmhTYLiYo2dSljOohUtuZgNndusvyDrlBILFPVefF/IAM8l4krtDLS2lotr1hEnK2o2F5VEdfBSz+p3r/TmJY8YvJyl6cZt82MS6JeTXx6io8/WABnAo9+/4qfHKfVTEGzWiJufBVQNoeOOhlsbhXC2KFJf3eY3Omde2ojsDqYDUHijEcxN6QojCwwxC8w== 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 MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) by SJ0PR11MB4928.namprd11.prod.outlook.com (2603:10b6:a03:2d2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.26; Mon, 7 Nov 2022 09:19:15 +0000 Received: from MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::f9b1:4118:554c:fcd1]) by MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::f9b1:4118:554c:fcd1%10]) with mapi id 15.20.5791.025; Mon, 7 Nov 2022 09:19:15 +0000 Date: Mon, 7 Nov 2022 09:19:09 +0000 From: Bruce Richardson To: Morten =?iso-8859-1?Q?Br=F8rup?= CC: , , , Subject: Re: [RFC]: mempool: zero-copy cache get bulk Message-ID: References: <98CBD80474FA8B44BF855DF32C47DC35D87488@smartserver.smartshare.dk> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D87488@smartserver.smartshare.dk> X-ClientProxiedBy: DB3PR08CA0016.eurprd08.prod.outlook.com (2603:10a6:8::29) To MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR11MB1629:EE_|SJ0PR11MB4928:EE_ X-MS-Office365-Filtering-Correlation-Id: 30f0cc4f-45c2-4e34-dbff-08dac0a123a1 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AyZVaTq3fo/B2AUcitHrO1q5iOMBO2bnyADFngSUaSDIq9Rk8XeRKtuhXYBMGwIUiIh058sP2iTB8F0lbfF3cxi8kxfKTJiGKmtrwggHoYe2Qbkt0s4HGW35uRcQVQrkJNFKEk5TSdMzUkvWAyiELb9j5ERZriexpCKMAka61cSKJKjRjUF7yUqyO3Nw2NgEopUBJmSpxomE0Jf9mvOJmYbzh/tpQ3BpjU530viov4xIJ788z1a4Y6jvtljz4FKZG114++CJcEKOrs7nQn5KXWOyT9iYf71T/+4ja5TLadXXOUId6d2XX1w+R0HsTZ8/1njGyLQCvHnHy72j0kfxycXcREQijHCIxAAqDD0EcARZa17i8LHvrkMGqOJ8/tvoZiUdukVF5UlCapj/ArKQwVnre2lCiJ9GwD31qNvEmTWEwAU5aWaVcbpuNOExTuIBTlpJ09FVKJ/oBpN3+2ZTVda+PMnhfD5hI7ALI9EEz1HLFpAf5xLupYwUJpmHW76TEytORuJWSqbRXsXQfK+YLtXOPvTs5VYf6TWwUu4oAUQnek3JO4f/5s5L14hnlec2T254CgUdpy7tiFfPZIwg81sari1TF0YopbY4w5iIyVG+/0JL8zbT1vTS/mJqRQhdfcmDkL3Lizuet+2d0ZGlCmJMz3/dbylIt5mkP5W5nq53xRQ+H8sE2+x/B8BfFS6ek9MMiO+Eb41l0GMbYDJJdNsoVR9BSrt1fq7QngoFlz4= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1629.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(396003)(346002)(39860400002)(376002)(366004)(451199015)(2906002)(478600001)(66556008)(66946007)(66476007)(8676002)(4326008)(41300700001)(44832011)(8936002)(966005)(6486002)(316002)(5660300002)(6916009)(83380400001)(26005)(82960400001)(6506007)(6666004)(86362001)(38100700002)(186003)(66574015)(6512007)(66899015); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?1MhBYykMfmHvrxUfFY2vrObVOp7xSwuqUshbjBOkKIKOnaNKShfOsuJ6Tm?= =?iso-8859-1?Q?CM8zpuSPyXtFrGie3Gx6fubhHqhca0G60GM0/bP3l4CCOamML2BqGbasn3?= =?iso-8859-1?Q?1wfI57KvGLvKj8qX+g9xO6J4frcFzTHiIoxot42Fmpk48N9xxw2C4k9EGK?= =?iso-8859-1?Q?8uarJHLejo8xis/IBMFvJTs5XY/3NvYuqGxniciSMQuczSESwLgnRrQVfU?= =?iso-8859-1?Q?HH4kJXAuiISJECeDCFpIUT+5GOz2DmJT520Fmfjv3We9vbuUDu6DKgnelB?= =?iso-8859-1?Q?x/IxpJNl0hC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1?Q?c0weNWMJ47S188DvnyiR8bUkj2k++w7h2bWG2ClKRxMBwGEhF6zT1ar1mB?= =?iso-8859-1?Q?EJ1L0/5jqKXXjb/JZwBFtUQaqI9p125PyZog4YWmYDGgl6tMfOAx8MhElR?= =?iso-8859-1?Q?T4gXi+sWJe/wN0iSck1OzGabosPplNIG3JHeZF1odJJ9TCAPQ8NDqPqIyG?= =?iso-8859-1?Q?Suht4btH5JkEZLqL6a/NJkv2dM9q9/mQYqNwCi6LGPirbfzU4Ceu7qEr7D?= =?iso-8859-1?Q?raJsx7KD4qIiZY8U2+JP+myI9uIx6Qwq2+QR6/gcg/lP3gF/9LgjwqDnua?= =?iso-8859-1?Q?VwTsqG1WuuRETAPO7KGOFvRjeJ/wZGBUGXEXPhDHy47JsnDL7mSuj7fBCe?= =?iso-8859-1?Q?YPpdb9QaOj11314ETPBMBuIweVSqiuaoD1Igo3/oN6QCLXeukVZdUu0Lje?= =?iso-8859-1?Q?iVL+HNz8PYcZIh+0Wt3936kWKd6M0rHqhWmJHOjmQwUJhCfplVbpR4qg?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 30f0cc4f-45c2-4e34-dbff-08dac0a123a1 X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1629.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2022 09:19:14.9308 (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: +sFQklh5rLsLsSfncaXOi5/JOeArZ4bMNl+JEJ6d2bX4Eq64tOwP1m8EA9pY1inrlrxGtyF1lAcZctNrB52nc3dPs6fW/bjXV7bbm4GBw/4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4928 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 Sat, Nov 05, 2022 at 02:19:13PM +0100, Morten Brørup wrote: > Zero-copy access to the mempool cache is beneficial for PMD performance, and must be provided by the mempool library to fix [Bug 1052] without a performance regression. > > [Bug 1052]: https://bugs.dpdk.org/show_bug.cgi?id=1052 > > > This RFC offers two conceptual variants of zero-copy get: > 1. A simple version. > 2. A version where existing (hot) objects in the cache are moved to the top of the cache before new objects from the backend driver are pulled in. > > I would like some early feedback. Also, which variant do you prefer? > > Notes: > * Allowing the 'cache' parameter to be NULL, and getting it from the mempool instead, was inspired by rte_mempool_cache_flush(). > * Asserting that the 'mp' parameter is not NULL is not done by other functions, so I omitted it here too. > > NB: Please ignore formatting. Also, this code has not even been compile tested. > > > PS: No promises, but I expect to offer an RFC for zero-copy put too. :-) > Thanks for this work, I think it's good to have. The existing functions could probably be reworked to use this new code too, right, since the copy at the end would be all that is needed to complete the implementation? Only real comment I have on this version is that I am not sure about the naming. I think having "cache_get_bulk" doesn't really make it very clear what the function does, that is removes items from the cache without copying them elsewhere. How about: - rte_mempool_cache_pop? - rte_mempool_cache_reserve? I would tend to prefer the former, since the latter implies that there needs to be a follow-up call to clear the reservation. On the other hand, reserve does give the correct impression that the elements are still there in the mempool cache. Others may have better suggestions, since, as we know, naming things is hard! :) Overall, though, I think this is very good to have. /Bruce