Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2030118rwd; Fri, 26 May 2023 00:08:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ58j5DZ+lCKGw9Fi1WdammT7s9wIMt2meFxz3wYirsLKeWXB0VPWJx4JNOX/RqsFS1NOccn X-Received: by 2002:a05:6a20:4290:b0:10b:cdb1:3563 with SMTP id o16-20020a056a20429000b0010bcdb13563mr1243882pzj.46.1685084889980; Fri, 26 May 2023 00:08:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685084889; cv=none; d=google.com; s=arc-20160816; b=tOH3YfgOHhd0SLLXcbhj03osq3l3LoErhKWckmdVZESeVUt1EGYL9g6vl+wSrlJ3+z nyWoJ2sPnMMWQBEWazXqgowErvSxtm9X0Z6as40e82Vr2jxlAcqYtxSH+PYCnRvohg9q fGNIDgvSi0qb14abV2eJLMu3qEWKpaB9fjuOezGhezaz+psK/ueEvzTiqeHC4tFwdQGg BpM4I3MfrKll2ytAGi96fuEPmk/vuuZBvMS7ZQDM0gDknW2atCDXZDifa7hAy+Tvu+ya 9/Zom9lc4nHAd0jHs3flp155ZwLDAcnl2BFbY4KiXiM4lkUyc4/C2nCZ1Lq8eI2CzKqg Yybw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=UmHbRSb5si8BJQAjf7lf8an5WP7e1V4xA9z1nusJqfo=; b=UtUJEjLIWOnMEvvHhF0VNdvxIsoqsI44QhaZ4Gstx62a4dlwFEnvn9m3xa4WAAtUUI 4DQDIkjP9d5//c61UyLnFM7LjVMOoAx5xjleHII+VjksWENp70U9PKR54JOxLEbdzpTn N/9n9uZxBO2sdSu7Op3Zw5xZBgWtwkWPhwSllO+KC2W4zWyzzmjOzXpSs/ktciMM6wPx 7yXsPw0oeJsxJY0ehHITSIMUMCI6H0ultjaSl2GAVoWEzoK1NEqhSAyxF08E0SNiGEmD Wfo0ytzDTRgpwApm8mTn++YoJac0vbCo0569nC5wb1kFt+Vf/acIKoQG9pTj5mOO3ueo omrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=jnvGkXV2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o27-20020a63921b000000b0053f280bacc6si753362pgd.166.2023.05.26.00.07.57; Fri, 26 May 2023 00:08:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=jnvGkXV2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242301AbjEZGph (ORCPT + 99 others); Fri, 26 May 2023 02:45:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236735AbjEZGpf (ORCPT ); Fri, 26 May 2023 02:45:35 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64F7DBC; Thu, 25 May 2023 23:45:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1685083534; x=1716619534; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=IJu7yRqmaECoG+aUqI9gqOkbcGWsi1NNfVI1riIMsLk=; b=jnvGkXV2jj7ELXJylaWO2oE/vW6V8LmVSo/Bs39Vj2SR/Dsxfp+E/lED e+8GHyzXw/PrTx7iXpKtYuUA43VzCG3u7op8Pd1ZMoe7xuPXfiNZ1ktMG x0XvZOwlkCkRImqxxTYAe3GC4+8GkrwWvMcQ3HkBl1wZmXUrBYR6DrjVq 5thcfyCW3jCkHMb2k7Sm80tKGZUv2++x26E+54HnN6+Co7yBw+2JKzrVJ HW0ytnoCF/fKbuI908kxFwXSjCVFGc22yMdBmbBliDUVHrZYfyfijTwm5 p5p8jfLTDGmWdcrLk7J6Y5uKJEJRTG2yGZ+I5a96nqkXyVCq9JrCOzBel A==; X-IronPort-AV: E=Sophos;i="6.00,193,1681196400"; d="scan'208";a="217418416" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 25 May 2023 23:45:33 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Thu, 25 May 2023 23:45:32 -0700 Received: from localhost (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Thu, 25 May 2023 23:45:32 -0700 Date: Fri, 26 May 2023 08:45:31 +0200 From: Horatiu Vultur To: Haiyang Zhang CC: "linux-hyperv@vger.kernel.org" , "netdev@vger.kernel.org" , Dexuan Cui , KY Srinivasan , Paul Rosswurm , "olaf@aepfle.de" , "vkuznets@redhat.com" , "davem@davemloft.net" , "wei.liu@kernel.org" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" , "leon@kernel.org" , Long Li , "ssengar@linux.microsoft.com" , "linux-rdma@vger.kernel.org" , "daniel@iogearbox.net" , "john.fastabend@gmail.com" , "bpf@vger.kernel.org" , "ast@kernel.org" , Ajay Sharma , "hawk@kernel.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: Re: [PATCH net] net: mana: Fix perf regression: remove rx_cqes, tx_cqes counters Message-ID: <20230526064531.zohcgjbaraq7c2ui@soft-dev3-1> References: <1684963320-25282-1-git-send-email-haiyangz@microsoft.com> <20230525064849.ca5p6npej7p2luw2@soft-dev3-1> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The 05/25/2023 14:34, Haiyang Zhang wrote: > > > -----Original Message----- > > From: Horatiu Vultur > > Sent: Thursday, May 25, 2023 2:49 AM > > To: Haiyang Zhang > > Cc: linux-hyperv@vger.kernel.org; netdev@vger.kernel.org; Dexuan Cui > > ; KY Srinivasan ; Paul Rosswurm > > ; olaf@aepfle.de; vkuznets@redhat.com; > > davem@davemloft.net; wei.liu@kernel.org; edumazet@google.com; > > kuba@kernel.org; pabeni@redhat.com; leon@kernel.org; Long Li > > ; ssengar@linux.microsoft.com; linux- > > rdma@vger.kernel.org; daniel@iogearbox.net; john.fastabend@gmail.com; > > bpf@vger.kernel.org; ast@kernel.org; Ajay Sharma > > ; hawk@kernel.org; linux- > > kernel@vger.kernel.org; stable@vger.kernel.org > > Subject: Re: [PATCH net] net: mana: Fix perf regression: remove rx_cqes, > > tx_cqes counters > > > > [Some people who received this message don't often get email from > > horatiu.vultur@microchip.com. Learn why this is important at > > https://aka.ms/LearnAboutSenderIdentification ] > > > > The 05/24/2023 14:22, Haiyang Zhang wrote: > > > > Hi Haiyang, > > > > > > > > The apc->eth_stats.rx_cqes is one per NIC (vport), and it's on the > > > frequent and parallel code path of all queues. So, r/w into this > > > single shared variable by many threads on different CPUs creates a > > > lot caching and memory overhead, hence perf regression. And, it's > > > not accurate due to the high volume concurrent r/w. > > > > Do you have any numbers to show the improvement of this change? > > The numbers are not published. The perf regression of the previous > patch is very significant, and this patch eliminates the regression. > > > > > > > > > Since the error path of mana_poll_rx_cq() already has warnings, so > > > keeping the counter and convert it to a per-queue variable is not > > > necessary. So, just remove this counter from this high frequency > > > code path. > > > > > > Also, remove the tx_cqes counter for the same reason. We have > > > warnings & other counters for errors on that path, and don't need > > > to count every normal cqe processing. > > > > Will you not have problems with the counter 'apc->eth_stats.tx_cqe_err'? > > It is not in the hot path but you will have concurrent access to it. > > Yes, but that error happens rarely, so a shared variable is good enough. So, I > don't change it in this patch. OK, I understand. Maybe this can be fixed in a different patch at a later point. Thanks. Reviwed-by: Horatiu Vultur > > Thanks, > - Haiyang > -- /Horatiu