Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2745509iog; Mon, 27 Jun 2022 01:55:52 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tCojULFMGnFvotuNGhaENMWxZbhVfg98qFhZV/rvuR9xANWSTCnVUaCVfTOoEzILT8u/xm X-Received: by 2002:a17:907:6d05:b0:726:a670:253 with SMTP id sa5-20020a1709076d0500b00726a6700253mr4126950ejc.23.1656320152241; Mon, 27 Jun 2022 01:55:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656320152; cv=none; d=google.com; s=arc-20160816; b=Hx3TYxTbAm6Yx/+UZht822yHvcj6wqu5GKQStLOPFARw50KKZxSsQMcAMNTkC8awXR EWwepRA+fEDoyiNHsRITwsJ5Is8x8ZzV2bQmIqH8pWg8OUHfhU6OXR5fi2tmCFJSZPue 6F5Vh2rtrlk54JwGXQpwOIHQ/IlWmNSqsycKrFkcyr7JBcNCkl0jswQJrhI8I2nGe9w+ qmkWSmGVRXh6pcrL7GRadzj+80IUgK1gTUWFD29KLsk0fqf0lfF21vPsxhLIvXYcj4Xu 99dMp6uoRFDA1tojC7BCmefjl9Tc8HhUEZrXTaVkr2EJc6TR/lfJKgM7kMB0Sv9ObLiS 12cw== 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=4vsOnIc+C2gY1UVlbVz/JDciMvgYEap1WYGcSJm7nik=; b=sRb2jc7YDa0bgySYFHRChrKxGKTDOFvSzTINYFq/I3QpMq0e4WCg0R0qQ/S38R9Fbl R3Bp1ngqjw1bH4X6rtLEfztF71doXdvrZnAw0rGeDex6YhLe28kML3i9Qqcb7eZBeMgB cpzzMWcb6Kw2fryEWw3iB9ya5FraThPM+WKciFPSdhXCmTQkBqkuHaf3OR0SKtfr0Z/6 bkmKaXN4Ag3r92RYJmn+XaDKjTPUX95xyev2HovcorYIzF2LAfEQDzbT/yvR7HmrRQ8C Gx08XeoY4/QyXBK6mPaFyKD6miOlCXoEiWiaxiUpoH7q/hzBT/vOqDTS9K8Vba6ucetI EczQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=izm5TvVa; 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 hg7-20020a1709072cc700b007075a3f9afbsi11936921ejc.377.2022.06.27.01.55.28; Mon, 27 Jun 2022 01:55:52 -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=izm5TvVa; 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 S233131AbiF0Iqg (ORCPT + 99 others); Mon, 27 Jun 2022 04:46:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233019AbiF0Iqe (ORCPT ); Mon, 27 Jun 2022 04:46:34 -0400 Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA4DA6353 for ; Mon, 27 Jun 2022 01:46:33 -0700 (PDT) Received: by mail-yb1-xb2d.google.com with SMTP id g4so3983168ybg.9 for ; Mon, 27 Jun 2022 01:46:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4vsOnIc+C2gY1UVlbVz/JDciMvgYEap1WYGcSJm7nik=; b=izm5TvVaySgpwnEQF9/y67fAWYu9B2xhHcC5MrbsqfKRyBWcvUJOefttP3U8C7H5yK cf/c+G/MDFeL9d3jWR3ZM1W+uRZZqwp2hTAlphjRcQ4y5gzmknF6zrBjrzS5Oq9593TH prMhKu/+/nH//vvJzE+A8myFZw0Vf2YB5togDcAyh2pSj1lg7+NXGygkUac2Pq5BEBXO 5+wwtXrzIkpK6w7dEXtmMbM9imlU0I4M6KLt1i3bZoyGQ30Vb87yxIZpNyIgjCBXAtgw DSd6AsFRpnuauM1qBq8q0T/kLZUm8tLjA1oB1Fx/TPENkDLwNudIWg8vpilEWofAkp3b qS3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4vsOnIc+C2gY1UVlbVz/JDciMvgYEap1WYGcSJm7nik=; b=oJLa0ziUJtUmkj0rqLB1KIVnCsymH5FwINwKY/SCsd3wuQwU7D4P+cSXKoEMhlghfo XzwBhh96DBk8A+jPG5KcX8v92JMVgJZGXcN644iw9skrECkhRqr9wEiJO+4T/URCcSna fG0oANLdei9VCXd/Cedrtll6g5qKDV7/95UNnSLAaA5Ce/zjus/8fgYT25b9KmdP5lU7 nHdD+X+sKQe85YJl5tKU+dIMgbA+c/eY4XU05ww+SLxfstvm6PehcFQ3Fqj9q3GqojYy ZwGpMbtrDXoBMTyQiY41j0AzwP2wgyGD6518nOebSz/TCSrwdGugIZY6Or7fyX8dXeU+ 6IfQ== X-Gm-Message-State: AJIora8mZIZ+HCkGlwmatWYcC1RxXEvKboCmMNdR8OWfpONx/3gf3dQ8 NKvnhM8MwHZuTSEGZKfogLvrPZilKGMEpQzISDh3GQ== X-Received: by 2002:a25:6c5:0:b0:669:a17a:2289 with SMTP id 188-20020a2506c5000000b00669a17a2289mr12352386ybg.231.1656319592797; Mon, 27 Jun 2022 01:46:32 -0700 (PDT) MIME-Version: 1.0 References: <20220619150456.GB34471@xsang-OptiPlex-9020> <20220622172857.37db0d29@kernel.org> <20220623185730.25b88096@kernel.org> <20220624070656.GE79500@shbuild999.sh.intel.com> <20220624144358.lqt2ffjdry6p5u4d@google.com> <20220625023642.GA40868@shbuild999.sh.intel.com> <20220627023812.GA29314@shbuild999.sh.intel.com> In-Reply-To: <20220627023812.GA29314@shbuild999.sh.intel.com> From: Eric Dumazet Date: Mon, 27 Jun 2022 10:46:21 +0200 Message-ID: Subject: Re: [net] 4890b686f4: netperf.Throughput_Mbps -69.4% regression To: Feng Tang Cc: Shakeel Butt , Linux MM , Andrew Morton , Roman Gushchin , 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 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=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 4:38 AM Feng Tang wrote: > > On Sat, Jun 25, 2022 at 10:36:42AM +0800, Feng Tang wrote: > > On Fri, Jun 24, 2022 at 02:43:58PM +0000, Shakeel Butt wrote: > > > On Fri, Jun 24, 2022 at 03:06:56PM +0800, Feng Tang wrote: > > > > On Thu, Jun 23, 2022 at 11:34:15PM -0700, Shakeel Butt wrote: > > > [...] > > > > > > > > > > Feng, can you please explain the memcg setup on these test machines > > > > > and if the tests are run in root or non-root memcg? > > > > > > > > I don't know the exact setup, Philip/Oliver from 0Day can correct me. > > > > > > > > I logged into a test box which runs netperf test, and it seems to be > > > > cgoup v1 and non-root memcg. The netperf tasks all sit in dir: > > > > '/sys/fs/cgroup/memory/system.slice/lkp-bootstrap.service' > > > > > > > > > > Thanks Feng. Can you check the value of memory.kmem.tcp.max_usage_in_bytes > > > in /sys/fs/cgroup/memory/system.slice/lkp-bootstrap.service after making > > > sure that the netperf test has already run? > > > > memory.kmem.tcp.max_usage_in_bytes:0 > > Sorry, I made a mistake that in the original report from Oliver, it > was 'cgroup v2' with a 'debian-11.1' rootfs. > > When you asked about cgroup info, I tried the job on another tbox, and > the original 'job.yaml' didn't work, so I kept the 'netperf' test > parameters and started a new job which somehow run with a 'debian-10.4' > rootfs and acutally run with cgroup v1. > > And as you mentioned cgroup version does make a big difference, that > with v1, the regression is reduced to 1% ~ 5% on different generations > of test platforms. Eric mentioned they also got regression report, > but much smaller one, maybe it's due to the cgroup version? This was using the current net-next tree. Used recipe was something like: Make sure cgroup2 is mounted or mount it by mount -t cgroup2 none $MOUNT_POINT. Enable memory controller by echo +memory > $MOUNT_POINT/cgroup.subtree_control. Create a cgroup by mkdir $MOUNT_POINT/job. Jump into that cgroup by echo $$ > $MOUNT_POINT/job/cgroup.procs. The regression was smaller than 1%, so considered noise compared to the benefits of the bug fix. > > Thanks, > Feng > > > And here is more memcg stats (let me know if you want to check more) > > > > > If this is non-zero then network memory accounting is enabled and the > > > slowdown is expected. > > > > >From the perf-profile data in original report, both > > __sk_mem_raise_allocated() and __sk_mem_reduce_allocated() are called > > much more often, which call memcg charge/uncharge functions. > > > > IIUC, the call chain is: > > > > __sk_mem_raise_allocated > > sk_memory_allocated_add > > mem_cgroup_charge_skmem > > charge memcg->tcpmem (for cgroup v2) > > try_charge memcg (for v1) > > > > Also from Eric's one earlier commit log: > > > > " > > net: implement per-cpu reserves for memory_allocated > > ... > > This means we are going to call sk_memory_allocated_add() > > and sk_memory_allocated_sub() more often. > > ... > > " > > > > So this slowdown is related to the more calling of charge/uncharge? > > > > Thanks, > > Feng > > > > > > And the rootfs is a debian based rootfs > > > > > > > > Thanks, > > > > Feng > > > > > > > > > > > > > thanks, > > > > > Shakeel