From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF943C04AA5 for ; Thu, 25 Aug 2022 06:49:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 58B2E940008; Thu, 25 Aug 2022 02:49:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 539BC6B007E; Thu, 25 Aug 2022 02:49:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 401A1940008; Thu, 25 Aug 2022 02:49:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 322376B007D for ; Thu, 25 Aug 2022 02:49:08 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 058F01418EA for ; Thu, 25 Aug 2022 06:49:08 +0000 (UTC) X-FDA: 79837187976.26.90210FD Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf06.hostedemail.com (Postfix) with ESMTP id 93335180003 for ; Thu, 25 Aug 2022 06:49:07 +0000 (UTC) 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> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661410147; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=hCOkZ1R+3Ps2iKEQMkAGWbxoqzFDDsd5JC+8lsArgGY=; b=SPLtdONYd2g1LvnPi0U0fRQzwqtnabpDgZxo1+tsbW66MTMfwBq4K/xYNTDPlUNHiUYZkF nYRzK9Q+QU6bxa9KYy4HgprNbm3KtyqB2HMmZcjq5/o79J9hBNDUtkDo7CVTIeAW+RKVea 4cdChe/NugR24GvIBrcCHx4i7Q22GGw= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=t+iNVMXg; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf06.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661410147; a=rsa-sha256; cv=none; b=1aeIusLI1s+/R18HEb2v6gJbR2s9kEHBTZnifFErnhDnfhsURoObbtqbNDLNB98K8gxkZr QWXbPDjcLsN0S/k8l8Yj4UCQEkgrJuvpYOLIwf6/oBr9lVu3sxnYUYlOg5Pr+ROB5DOgv2 CWs9hQRoNba1Yn6dAIfxJlBeAAaN7Jk= Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=t+iNVMXg; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf06.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 93335180003 X-Stat-Signature: yaxupp7ua55c7z3drfuhnh5ncjnahdzn X-Rspam-User: X-HE-Tag: 1661410147-133599 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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