Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp321909rwe; Thu, 25 Aug 2022 00:25:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR6B7Dh94ffi7GGX8Wyb5wig/mrMxxKJwQBE21I8M1QDPWJ3V2Fu/LJqv06u0QLA8MP2ZUje X-Received: by 2002:a17:907:6095:b0:731:87a0:b9e8 with SMTP id ht21-20020a170907609500b0073187a0b9e8mr1658120ejc.124.1661412322484; Thu, 25 Aug 2022 00:25:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661412322; cv=none; d=google.com; s=arc-20160816; b=cjkQrAPwvAxsrjQaMwzLvb4aJXgvue2wTB3409Y4lPvdOXutInNDwOmNyd6HQ73/2q OixdeiJB64kxrrT7FXKSmLNqBqpDyoiUPVgGlfz2IMXCm+J+5Za6UItQLbXwZH5PWUiK gcB4cC3ZesYsb4LUXIiE0h/yatIMg8DENZafKXH3m9SO2kYPhLEVynI0VvsI7p5YX4T8 lAKc+MlKNJZCeeP5U6llyq+Dvv/sWAak0rtxwJ16EoPX53D3aIkN91Q8iTuVpPOEo9Do hk+QljoAEuedj8s/0bDRID67B2Ls6dULG0C6mF4EysH4G+MqYMV5Smtx52rpBj64w9vJ DqLw== 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=hCOkZ1R+3Ps2iKEQMkAGWbxoqzFDDsd5JC+8lsArgGY=; b=kRq8BQJc8TOOMQKSdsnrc4CGuTTTjgYIbXNPPSdR2/9fWyZjAYsz+1MYvmulQUXnXv 3jXT1/CQhmPLlwn7DvYfPZ7Xt1UqP/a/I1kRo2L4ZTRfVGCnmRHlXkv94FzFcNvhJUiJ HW1o24fi6C9OZyFfRhCU8crP08KAfFuxN6OqJWFmweHLGRpdOPySaUNJ3NzjNbCQDuCe M3NF3zZ9BSL2fqN7xMzENeqMz2KdoNvTLO17yXZ/Iup0xN1r8vat4zgEwpcVzjyklQBG On599EqW8DpjfeM//RpwrWL1vsco0HyVpaS7o4k4U2sTfOqJpp9zn4HMd5IuE43tBtRI vEiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=t+iNVMXg; 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=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u16-20020a1709064ad000b00732fb970fe3si2664205ejt.187.2022.08.25.00.24.57; Thu, 25 Aug 2022 00:25:22 -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=@suse.com header.s=susede1 header.b=t+iNVMXg; 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=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235484AbiHYGtK (ORCPT + 99 others); Thu, 25 Aug 2022 02:49:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230302AbiHYGtI (ORCPT ); Thu, 25 Aug 2022 02:49:08 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D95DF76741; Wed, 24 Aug 2022 23:49:07 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 934735C889; Thu, 25 Aug 2022 06:49:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1661410146; h=from:from:reply-to: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=hCOkZ1R+3Ps2iKEQMkAGWbxoqzFDDsd5JC+8lsArgGY=; b=t+iNVMXgawnOo26nJ0TYL5x/n2/mTXp5VPRShA6ztSQWzxIh3W0eaKXh+Lm7NRjG+9vVAG My0w3z2TjVgNuaHWVhhBjJkd874Xto/GeUkKCuohcF8xCIMjWj2eHVInmxCW/uYnIZ69gP 7pfKhI3yz9xq8yt/uPBJ9lMRs7vD50Y= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7555C13A47; Thu, 25 Aug 2022 06:49:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id J7Y0GmIbB2MtPgAAMHmgww (envelope-from ); Thu, 25 Aug 2022 06:49:06 +0000 Date: Thu, 25 Aug 2022 08:49:05 +0200 From: Michal Hocko To: Shakeel Butt Cc: Johannes Weiner , Roman Gushchin , Muchun Song , Michal =?iso-8859-1?Q?Koutn=FD?= , Eric Dumazet , Soheil Hassas Yeganeh , Feng Tang , Oliver Sang , Andrew Morton , lkp@lists.01.org, cgroups@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/3] memcg: increase MEMCG_CHARGE_BATCH to 64 Message-ID: References: <20220825000506.239406-1-shakeelb@google.com> <20220825000506.239406-4-shakeelb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220825000506.239406-4-shakeelb@google.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,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 On Thu 25-08-22 00:05:06, Shakeel Butt wrote: > For several years, MEMCG_CHARGE_BATCH was kept at 32 but with bigger > machines and the network intensive workloads requiring througput in > Gbps, 32 is too small and makes the memcg charging path a bottleneck. > For now, increase it to 64 for easy acceptance to 6.0. We will need to > revisit this in future for ever increasing demand of higher performance. > > Please note that the memcg charge path drain the per-cpu memcg charge > stock, so there should not be any oom behavior change. Though it does > have impact on rstat flushing and high limit reclaim backoff. > > To evaluate the impact of this optimization, on a 72 CPUs machine, we > ran the following workload in a three level of cgroup hierarchy. > > $ netserver -6 > # 36 instances of netperf with following params > $ netperf -6 -H ::1 -l 60 -t TCP_SENDFILE -- -m 10K > > Results (average throughput of netperf): > Without (6.0-rc1) 10482.7 Mbps > With patch 17064.7 Mbps (62.7% improvement) > > With the patch, the throughput improved by 62.7%. > > Signed-off-by: Shakeel Butt > Reported-by: kernel test robot > Acked-by: Soheil Hassas Yeganeh > Reviewed-by: Feng Tang > Acked-by: Roman Gushchin Acked-by: Michal Hocko Thanks! > --- > Changes since v1: > - Updated commit message > > include/linux/memcontrol.h | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h > index 4d31ce55b1c0..70ae91188e16 100644 > --- a/include/linux/memcontrol.h > +++ b/include/linux/memcontrol.h > @@ -354,10 +354,11 @@ struct mem_cgroup { > }; > > /* > - * size of first charge trial. "32" comes from vmscan.c's magic value. > - * TODO: maybe necessary to use big numbers in big irons. > + * size of first charge trial. > + * TODO: maybe necessary to use big numbers in big irons or dynamic based of the > + * workload. > */ > -#define MEMCG_CHARGE_BATCH 32U > +#define MEMCG_CHARGE_BATCH 64U > > extern struct mem_cgroup *root_mem_cgroup; > > -- > 2.37.1.595.g718a3a8f04-goog -- Michal Hocko SUSE Labs