Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp1814391rwa; Sun, 21 Aug 2022 18:17:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR7eck3x/iLcKvbEUXEwnYod+95m+BXD+aRPzsxDo4cYlA6A6Ve5Z/oA9BNGWmz9lV5cWabf X-Received: by 2002:a17:907:7389:b0:73d:81a1:d562 with SMTP id er9-20020a170907738900b0073d81a1d562mr1792546ejc.27.1661131024700; Sun, 21 Aug 2022 18:17:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661131024; cv=none; d=google.com; s=arc-20160816; b=zqNdAtZhXbr/rxRHXkee29Qx4T2tnLX6cx+Q4Ju8S2VxjkhtMgLEaGD+jgzm98VMU3 tR/5jOpf4nB6Oz8DHop3kMcxmz7aqcJK6ABDbhyYnLBjERc68PUtXB/6b9iltASgr51d ThDANEQ38jLSYIc4GGkYT55FyT2g1Q/6RRSlCau59NwfoWXYCH6r266St2BUjWNb47RE SS9HHN5tmOzzp0eMzkGLmZYVcf7AmHL37987DKcvYRag+5gxcG2AkhMcQuM2Px2CxSef ONL1wzH/s3KoqXDT6Vt+QjdJapxfUuBPqE6YESwdXy7g4IyTVA4FZsHvBsD7bs368obO iwlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=vOM6Qk7H6503nwlxurWDnApj6tGcPYJKuggwnA4Q7DI=; b=jZUayfi8ldx0zVRf714CzaeiUzG7jQTDXXxIAgAEXgaCR99sL9dmtQ9FPHxdwzKoXI FboZk9MroegB5Xrg4G3qKx/4408e5pV52Opo3Ad8OZxrjdNJQ83WpEH/S8RlLZd68UHu dIXV4rOCx07S2fV2wR3uVJjlTtaSW34gn/kytUqqv/dIF2o2ZIKab4EzNr0oXOm//elN ey8qajEdQXhuPSXzDlSayhL936TwmbqkRlFYZVCViwMoKtdLgyNCPfp87ZUChatS0Mw6 0U0MjNGDb8+/t870jfof1wPUmPB7PEJTR77lOQ8SDu1DfeyBU0K2JMyE/zfEelwWjvXW GLRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=d18GG+Bt; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gn30-20020a1709070d1e00b0073d6590a430si4990654ejc.382.2022.08.21.18.16.39; Sun, 21 Aug 2022 18:17:04 -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=@google.com header.s=20210112 header.b=d18GG+Bt; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232087AbiHVAZR (ORCPT + 99 others); Sun, 21 Aug 2022 20:25:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232075AbiHVAZP (ORCPT ); Sun, 21 Aug 2022 20:25:15 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 383AE201A8 for ; Sun, 21 Aug 2022 17:25:14 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id u15so9592978ejt.6 for ; Sun, 21 Aug 2022 17:25:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=vOM6Qk7H6503nwlxurWDnApj6tGcPYJKuggwnA4Q7DI=; b=d18GG+Bt516p+zMinyCQn18btHPsTUkM8kPzrVj0qRlWdy2iXgPx5SdfNKsgRcQ5+t OtpT4LYrHOqGSPN6EtuMYhEn51cgY1lIg1cVM4bqJBczwtMS70sLDPg356P2VE3PM9Dh mgRZekRTLn1Ac3RMfhbmkkN+PXDbsIU/PgXaHy/nHlK1uWtZJVQNzXTxZ/9TdY4yv7E7 6YRljr0tzGJfVO75aEh2zLCwUUaQb+K9LDB+6+a6DUjZevqZX+VoHbDggFmctnlqzlJc uJuGiXe1qObFP1Y+nN/gYcpwbAf8zmYaSbZfrL1rUOPvdz8Vng8leg9pLCE7NFHmnv79 eBNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=vOM6Qk7H6503nwlxurWDnApj6tGcPYJKuggwnA4Q7DI=; b=0ULN47uvk0a1bU0l3xkHGxdQExJKuF2vWg9Fg+JUhB4+mTP8rGQ/ZUX5M8sgU6C6jG wKRp2udq6wyZqlz73LGTR7wYgvL5lICQiXlm0qSMZSiTjzKeDYrMFOoCkGJHht7LwrY8 1YK+wHstPZJECu7aXxG+PcvoIczPuzIh4WZsFHfzp+984dZz8sx6rjvv5QG0OE2rZVSG ay3WmH8yGOU0iruuxqbE5Mqc8425p09r9MFWCXSzIX2WO0LXWKm1cElC+6wndjey92H2 Ok/gMgkin2gv1zUpBtksPwYAnwJkvQX9WYHueBgxzgukloARh68SHKHEC5JQ76rqWw+Z 6wgw== X-Gm-Message-State: ACgBeo3wJ2jjgrZLI7uU/KZ8GmdXnOS85lbNqiB/orMC8TnYiNT3tudd oskWtcAJQgRcFrhTsCy4EBbyakupeAe9jEwHzBhWmA== X-Received: by 2002:a17:907:608b:b0:731:8a9d:5a2d with SMTP id ht11-20020a170907608b00b007318a9d5a2dmr11502290ejc.443.1661127912457; Sun, 21 Aug 2022 17:25:12 -0700 (PDT) MIME-Version: 1.0 References: <20220822001737.4120417-1-shakeelb@google.com> <20220822001737.4120417-4-shakeelb@google.com> In-Reply-To: <20220822001737.4120417-4-shakeelb@google.com> From: Soheil Hassas Yeganeh Date: Sun, 21 Aug 2022 20:24:36 -0400 Message-ID: Subject: Re: [PATCH 3/3] memcg: increase MEMCG_CHARGE_BATCH to 64 To: Shakeel Butt Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , =?UTF-8?Q?Michal_Koutn=C3=BD?= , Eric Dumazet , Feng Tang , Oliver Sang , Andrew Morton , lkp@lists.01.org, cgroups@vger.kernel.org, linux-mm , netdev , linux-kernel Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 Sun, Aug 21, 2022 at 8:18 PM 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. > > To evaluate the impact of this optimization, on a 72 CPUs machine, we > ran the following workload in a three level of cgroup hierarchy with top > level having min and low setup appropriately. More specifically > memory.min equal to size of netperf binary and memory.low double of > that. > > $ 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 Nice! Acked-by: Soheil Hassas Yeganeh > --- > 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 >