Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3526752iog; Mon, 27 Jun 2022 18:58:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u1Dy1D8Srs2weIilrIeWctX+srl8KQ2PpNr4NeHwbB3ua+OGnNn2sxdRU1merSLfjIW+Td X-Received: by 2002:a63:4a0b:0:b0:40d:d4c1:131f with SMTP id x11-20020a634a0b000000b0040dd4c1131fmr10749278pga.242.1656381511852; Mon, 27 Jun 2022 18:58:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656381511; cv=none; d=google.com; s=arc-20160816; b=ALYOYUKy7fC4UPH9qTn+oMuaFQ6haKY4nsmge3JuwZgRPHQLCm8PUvzQR6mhbS7BHO Uz4ZOLffuovVCgkRBsQ0I1hovgk3LVqigys3WuR6cBjcQ76n4fzYU9wMuszx1SNmY6+k eggTYAJYDgR/VPUoBWSUP8v9b2dCvW8GWCkPz2SzV+x9miiwij8zoJjDwF0cTrppvd+f x5sCGjQPcVwbgy5igz+BWVCY7AgSqvmmBQufLH2qODRjVYe1Qg3z6jn8UX5pY55DSl69 5oS/OcvfsAuF9X6himBLy8ppkkv8xnBqA1lvtrs+Qr/aAfeN3DWkV/MfU8d+EQ2+dGlp jRCA== 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:dkim-signature:date; bh=ORdLe5wVx7GzxxMtzEujYJBVbDhPT8vtTYMDRzc+hUM=; b=GEdlhNjCXG5dQ9c7xsu6G4vFSzLemhMYVQiESH4eMrfW0tGD0cGZiLmP7f39ca6oS4 o6ter1UyurF3WXm2QR1tOVanxPCPsPFc/kKgVNzwuCwsMYM1+YSVDI65n4oGLm6J53af /Lp3VG2VueU8udp65m8jWwXQs3pK5TyaS+YEu18eDU13eG5nRKDgJAJ2zg7DMCktMg6t JlePcIhWYopwUCkEz3NjtXV41qJLfH0hkJL52rM1yWUXbNJqoGzVE23QtPMm8fokx+hE hawTlLb0zBUjDCPmBLhAxGk0Or4NfB81SVO93FSt0yTMJSbTilA9WIbUJBVmzbcP76yh LOAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ctCXHWlV; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n3-20020a170902f60300b00164027788e8si16392480plg.254.2022.06.27.18.58.18; Mon, 27 Jun 2022 18:58:31 -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=@linux.dev header.s=key1 header.b=ctCXHWlV; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242406AbiF1BrG (ORCPT + 99 others); Mon, 27 Jun 2022 21:47:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234947AbiF1BrE (ORCPT ); Mon, 27 Jun 2022 21:47:04 -0400 Received: from out1.migadu.com (out1.migadu.com [IPv6:2001:41d0:2:863f::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B32A18E29; Mon, 27 Jun 2022 18:47:03 -0700 (PDT) Date: Mon, 27 Jun 2022 18:46:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1656380820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ORdLe5wVx7GzxxMtzEujYJBVbDhPT8vtTYMDRzc+hUM=; b=ctCXHWlV79XK06hz0/egR14h1WrQtW6OqdpoYuhXrwnV4k6ahAaXCUNyw4vskHn4vKSf+m 3WlYbBfaHxPvdtR+zayNdLZiOJnjqFjG1N23ON6FHn1abZfSgM5OwfnZqbiWeASScl0i7c LMyQj8wvsIK0gksoQYXXMp5JpN1W4y0= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Shakeel Butt Cc: Eric Dumazet , Feng Tang , Linux MM , Andrew Morton , Michal Hocko , Johannes Weiner , Muchun Song , Jakub Kicinski , Xin Long , Marcelo Ricardo Leitner , kernel test robot , Soheil Hassas Yeganeh , LKML , network dev , linux-s390@vger.kernel.org, MPTCP Upstream , "linux-sctp @ vger . kernel . org" , lkp@lists.01.org, kbuild test robot , Huang Ying , Xing Zhengjun , Yin Fengwei , Ying Xu Subject: Re: [net] 4890b686f4: netperf.Throughput_Mbps -69.4% regression Message-ID: References: <20220624070656.GE79500@shbuild999.sh.intel.com> <20220624144358.lqt2ffjdry6p5u4d@google.com> <20220625023642.GA40868@shbuild999.sh.intel.com> <20220627023812.GA29314@shbuild999.sh.intel.com> <20220627123415.GA32052@shbuild999.sh.intel.com> <20220627144822.GA20878@shbuild999.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Mon, Jun 27, 2022 at 09:48:01AM -0700, Shakeel Butt wrote: > On Mon, Jun 27, 2022 at 9:26 AM Eric Dumazet wrote: > > > [...] > > > > > > > I simply did the following and got much better results. > > > > But I am not sure if updates to ->usage are really needed that often... > > I suspect we need to improve the per-cpu memcg stock usage here. Were > the updates mostly from uncharge path or charge path or that's > irrelevant? > > I think doing full drain (i.e. drain_stock()) within __refill_stock() > when the local cache is larger than MEMCG_CHARGE_BATCH is not best. > Rather we should always keep at least MEMCG_CHARGE_BATCH for such > scenarios. +1, really good point.