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 9D5C8A0093; Tue, 8 Nov 2022 16:59:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 80E6140151; Tue, 8 Nov 2022 16:59:37 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 9DA52400D4 for ; Tue, 8 Nov 2022 16:59:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667923175; x=1699459175; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=W3soWi4LkAo+O83rHB2Be8j/J7he7w10SQkw/qBVUsQ=; b=S/piFChfqSvAju0K14QNP8j4c+7tUg02ceWJtL9aqYcf5KGzzYAyDNrx fDMD2MZ/UcjMnzgP/AQSsi/vkKK2pejL9CHDLJS4O/t3qlTehAWxSaCpb fLwlD20/i9VZKCforVx6+xLtzP8KigAEANhfPhA4tdqvdNIDptGgleaoV K5WCpF9r842pPjduh4z4SlfjyWrmJ4YHCCMlZfAN3mxgv4IVqIUX9O1LN CvajUkvXpePjA+KYLGc+RaRanxPXsTJ87Pj4I+2d25l3ddipjJdVDC5Ud 9BTqdXZatuqw5RjSPU391SIeEEWOCj3pgTBCIOrvwxg8DoVI6l5AuH583 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10525"; a="312522047" X-IronPort-AV: E=Sophos;i="5.96,148,1665471600"; d="scan'208";a="312522047" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2022 07:59:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10525"; a="811287223" X-IronPort-AV: E=Sophos;i="5.96,148,1665471600"; d="scan'208";a="811287223" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga005.jf.intel.com with ESMTP; 08 Nov 2022 07:59:34 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 8 Nov 2022 07:59:34 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Tue, 8 Nov 2022 07:59:34 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.100) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Tue, 8 Nov 2022 07:59:33 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a2ps6qrS+1K4BR4k9GCjegfav4zAWgC7DVw/2xNa4IJNPA+cJWv8twSouyVdBX02hhyOD0HvJ61/cUHA7pNZ2tryp2CbiYFmTYXFZheWPyvTyhPgbry1jfdmOo7tMzEceNXtNgE+C2owcv1lPE/v4e5JYpyCg5/3UIT+0vN6jFDgunoysaxnQT08PAzb781jO4GFL3DiW4mpy3EazkV3iKPw8FmZ2nB199AMYL8m2oj4opS6mADnkqbqbKV57qQXLJrwpdMW7+5cYAzgAV/PNPOUEUCoW8y2vtboDlcPT0vOVk/D86w6GzFOYEzeBxHhMI3wmQ7Jye9fDDmkRZ+RZQ== 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=luUDaSmzs/NQM3iK3tbp72JZNTX8QKU328bQ/5G3BXg=; b=UFkES2uvhWOlJG2EDQvhYSo+FgwWYrQjCBtY/kXQSXeC9xvH2/GeM6U6HtkkH3Dej84Ry+LEHbHMUK8AW86VwAtxzvhowmT0Oz22ttAkehgdMFnyOYlTuHKZq187PFa5PSTlTcGF9iWoqGbJxqXTV9v2rm4d5TcfHcVWrVkQPrPadlGOWdMcJ4Wdlgigl0djYDtNqu06D31iLU4GufZH4X4KcukWqxYFMk4n3rb73sCLO2Xrz5TIZNePb3HrnLXN6PNsjS5CacNuG2uexf2z1npwXvyxirfvcCAAq3fitivbxNj34ysq/OhP8M+QnhdkgcNIuhX4UHYxUmoEfyMl9g== 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 SN7PR11MB6774.namprd11.prod.outlook.com (2603:10b6:806:265::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.26; Tue, 8 Nov 2022 15:59:28 +0000 Received: from MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::196a:c8b2:40ec:c6f8]) by MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::196a:c8b2:40ec:c6f8%10]) with mapi id 15.20.5791.027; Tue, 8 Nov 2022 15:59:28 +0000 Date: Tue, 8 Nov 2022 15:59:20 +0000 From: Bruce Richardson To: Thomas Monjalon CC: Morten =?iso-8859-1?Q?Br=F8rup?= , , , , , , Konstantin Ananyev , , , Subject: Re: FW: [PATCH v4 3/3] mempool: use cache for frequently updated stats Message-ID: References: <98CBD80474FA8B44BF855DF32C47DC35D874A1@smartserver.smartshare.dk> <6110999.17fYzF0512@thomas> <98CBD80474FA8B44BF855DF32C47DC35D874A3@smartserver.smartshare.dk> <2028060.trqCLbgVIZ@thomas> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2028060.trqCLbgVIZ@thomas> X-ClientProxiedBy: LO2P265CA0303.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a5::27) To MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR11MB1629:EE_|SN7PR11MB6774:EE_ X-MS-Office365-Filtering-Correlation-Id: be5410f6-3047-4ca5-d597-08dac1a23735 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: pS7exLpzEKG+DC4XGSwBNBMwPO0fCrLIixKfSFS1psoxiZgBzrF1dK1GRBNpDROVKRFv0JwOBbeU/LYTyjzYnOxtvVy1+vFAXnTVcbPC2ZVl+qr/tqttQwnYYp0NTkbegbZ1nwOzBbcVTwf0yPTPqSsi9KzRoyo2BUDJzB14+J1JVMlsC5VgL8GpGrKLOLVSXM2T+5qOLi7cVovQXlK3W1tU25ig9mSxHa1Llhrqa14XnXV96NGoIoERp3N64smMgdVRAsbHbBPg9kcbYVRU1VYtUavhwGVFj1uwEYqeoYnKES329ioaGba1sUWodBidCZccDJOhHawLbFK+iB/BRyXCHmmb/k1UL4jBNgYMb5L4I43s/NuW3s1nhWCAsmRFR4UXXKl+UzbNF1zk/aVYMv5PvfRGc58520juNhDQhrL5O8ttV85+MNQH6xBHKl/16Xml1W+5axj3dKcyxUe7l3kLrTobONlJaEgFCTZR40VCm7fjk86wS+cDZRY4O89W9nxn6xfWPat8ZEulJSjKmMEmkWxwB5UUEE/wnAQvnTt7QFtpUoLug5oNcvyaQuXQVJX5TPM3IVGfCIZB5bnDDdbnDJEeyIAPNoD5etVnnvuIuz/DSd3o3/BQXf0TrpuvFJtT1OmHQ74uO6kRIQ0a+94khuwWKTb2vVMfZx25tZM1q2r/30Uc/T5+6UaA3CEDrqAw9V/3237OX5ekkKRgPQ== 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)(396003)(366004)(136003)(39860400002)(346002)(376002)(451199015)(478600001)(6486002)(82960400001)(6916009)(54906003)(7416002)(66574015)(2906002)(6506007)(5660300002)(316002)(6666004)(38100700002)(4326008)(66556008)(8676002)(66946007)(66476007)(83380400001)(41300700001)(15650500001)(86362001)(8936002)(44832011)(26005)(186003)(6512007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?IjFB/OGC9W2vhmXLS4UBGCsxnTi+uXZgW15rEjbHZ5m/MXvfaLfHk+xK6b?= =?iso-8859-1?Q?rcNEnJXMHiFb7U3pbHin+zm0J7PWeSr4v1sfCQnRmzy+3HMtzYnPP6P4KX?= =?iso-8859-1?Q?n0wZKPF8R71SCAw7EYDVlqoZAOzNdTA03qGoBNVJwnQSakw2scNihSlbG2?= =?iso-8859-1?Q?EK/4vrTICXnHWCw0Pi9LNGIqd1a/AWRX6gWvhNgNGfStrsADwf7wcceCQU?= =?iso-8859-1?Q?nhDX5+E5FSBAR+9u50m3b/tadIkVqm3vO5B7J6F0xmEz6EiJrVO2waCRC2?= =?iso-8859-1?Q?YByHwRclvmwya7ID7zZsv9rrPOJbduj/+YTwGsNGfxtmH2tzrxYjNUu/7L?= =?iso-8859-1?Q?FKhB+q9en6JH8z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v?= =?iso-8859-1?Q?PjLA0VQPv+67q9MmqENkYRD4mTlzFwpCgWAFClFvHgRLTNLxQq2FHvuPCr?= =?iso-8859-1?Q?YRkeHTqNfC6F6K6UUrw2XbfW8ReYGCKV7JVqajnE4hSiidJo2aw/z22Qm7?= =?iso-8859-1?Q?iLJWChnWj5+q9+xzyLDym7UCTuN1KVjD9EV1h0DJDqZ8i8wKBwNDIKGNrK?= =?iso-8859-1?Q?A6PPxm2timxwpCPPHtKqfQdPY9i+Ba9e1hYnyY31/WEL2dP/wNuXF6M7TA?= =?iso-8859-1?Q?8JZr9VxlDxp3g+2klvHt+6eA+OAmvZUd+LSg8n/qd1ik7PV4ouT5FSBupb?= =?iso-8859-1?Q?+gge7jYKL9KqFjZFpomxZzFB4Juu7o2Li7PR1p4CDtgg4K5YYAYGbZlNuA?= =?iso-8859-1?Q?oR39gi8mR6QJW9mcWMextkDWa7mwDs2Jvtqu8lEHKotxVqVanCCxAoPg?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: be5410f6-3047-4ca5-d597-08dac1a23735 X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1629.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2022 15:59:28.4452 (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: RW4fnJL1ohQE6E89JYiFzty7TNpM3GYoQUDufBhrydhOMRTm6qKxqL3u393/6W3FWVJtqAzIPq3OJ8gOFFcj8BHAg7SCxNJXjU+0irKbP9g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB6774 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, Nov 08, 2022 at 04:51:11PM +0100, Thomas Monjalon wrote: > 08/11/2022 15:30, Morten Brørup: > > > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > > 08/11/2022 12:25, Morten Brørup: > > > > From: Morten Brørup > > > > > From: Konstantin Ananyev [mailto:konstantin.ananyev@huawei.com] > > > > > Sent: Tuesday, 8 November 2022 10.20 > > > > > > +#ifdef RTE_LIBRTE_MEMPOOL_STATS > > > > > > +#define RTE_MEMPOOL_CACHE_STAT_ADD(cache, name, n) (cache)- > > > >stats.name += n > > > > > > > > > > As Andrew already pointed, it needs to be: ((cache)->stats.name += > > > (n)) > > > > > Apart from that, LGTM. > > > > > Series-Acked-by: Konstantin Ananyev > > > > > > > > @Thomas, this series should be ready to apply... it now has been: > > > > Reviewed-by: (mempool maintainer) Andrew Rybchenko > > > > > > > Reviewed-By: Mattias Rönnblom > > > > Acked-by: Konstantin Ananyev > > > > > > Being acked does not mean it is good to apply in -rc3. > > > > I understand that the RFC/v1 of this series was formally too late to make it in 22.11, so I will not complain loudly if you choose to omit it for 22.11. > > > > With two independent reviews, including from a mempool maintainer, I still have some hope. Also considering the risk assessment below. ;-) > > > > > Please tell what is the benefit for 22.11 (before/after and condition). > > > > Short version: With this series, mempool statistics can be used in production. Without it, the performance cost (mempool_perf_autotest: -74 %) is prohibitive! > > > > Long version: > > > > The patch series provides significantly higher performance for mempool statistics, which are readable through rte_mempool_dump(FILE *f, struct rte_mempool *mp). > > > > Without this series, you have to set RTE_LIBRTE_MEMPOOL_DEBUG at build time to get mempool statistics. RTE_LIBRTE_MEMPOOL_DEBUG also enables protective cookies before and after each mempool object, which are all verified on get/put from the mempool. According to mempool_perf_autotest, the performance cost of mempool statistics (by setting RTE_LIBRTE_MEMPOOL_DEBUG) is a 74 % decrease in rate_persec for mempools with cache (i.e. mbuf pools). Prohibitive for use in production! > > > > With this series, the performance cost of mempool statistics (by setting RTE_LIBRTE_MEMPOOL_STATS) in mempool_perf_autotest is only 6.7 %, so mempool statistics can be used in production. > > > > > Note there is a real risk doing such change that late. > > > > Risk assessment: > > > > The patch series has zero effect unless either RTE_LIBRTE_MEMPOOL_DEBUG or RTE_LIBRTE_MEMPOOL_STATS are set when building. They are not set in the default build. > > If theses build flags are not set, there is no risk and no benefit. > But if they are set, there is a risk of regression, > for the benefit of an increased performance of a debug feature. > I would say it is better to avoid any functional regression in a debug feature > at this stage. > Any other opinion? > While I agree that we should avoid any functional regression, I wonder how widely used the debug feature is, and how big the risk of a regression is? Even if there is one, having a regression in a debug feature is a lot less serious than having one in something which goes into production. /Bruce