Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp348403rdg; Tue, 10 Oct 2023 12:02:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG4GS+hydupgVLgGkVeLRPRglddYK3keMmeAg4sl7z1cTlv+gw5jKa3CCgxX0RKFoo0JgJ2 X-Received: by 2002:a17:903:2309:b0:1c6:2acc:62d7 with SMTP id d9-20020a170903230900b001c62acc62d7mr20104365plh.15.1696964560414; Tue, 10 Oct 2023 12:02:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696964560; cv=none; d=google.com; s=arc-20160816; b=EylP+49Zgx7IbITUaN5gQM9GxHJY/QOPoKUTnCHO8u4ku0PhZmJmw4LLxrl6GVZ+wp pBUSP10KFwtPI+8SPBE+qkZLWlbQ6gG7uDKVsxWdRmKjkjX1d1TxV2qMIol8AAPNC//j Af+kPooU33C0cYN0hsyy77j2YvJU54Ndsp0/x3h9dGT+RoXSqWzq7dT82g1wq+Hb0M2z TjARstlrGi0+3gGM5/9w8rr9zWo2PPTp97AzkQPmt/drN4O0KjJhHlKEstp5YkzVXh6h 0Wpc6nB8M58NkJgmf+AWDnqmTQWwVain0XOcf4y98SzfsKE80+XOvg9FkmNZzg3/ueIr NjNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=5woyaOlfb5FRD/2ky2o7l2Lh0ZKAp5sQQeLB5eexnx0=; fh=Z30lDVRcbxWhLcoSCMRp+88OsUU1pbSwIag4eKjBark=; b=UclZ2/xoXEjoIaSYDGt38j6nbGy9OPzY23NitUwuM/Kh683+b0kCKJugjVe9lgvrKN tDaYNaqR4XSkSMOTaHlTjGktlF4u5NYRXf8FvExwIoYizYLeqOte8eFHTXbeuSMD0SFA 859DAsJVvQ0Ru/MPkrR8wUx23FI3aHzhHvIANv7gkByyGV+jkZCU5FWReSMMAzqlL4bO xJbja4o5WHr15XRsDnRnkTF2rNykdWIHiVF2fg5287uVxohvTI6DCKHnUcyUB3kSJLad Q43XmS9mNpT5w/b4XZcb9VBCIV/VSWSSXfi5Th5EUhaGyJAeAJqFjGDUBlv0CuD9K7TO NzLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=SwerxqFM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id q5-20020a170902a3c500b001c76e9f12a3si12558525plb.575.2023.10.10.12.02.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 12:02:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=SwerxqFM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 83A7881BB4E5; Tue, 10 Oct 2023 12:02:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233674AbjJJTC2 (ORCPT + 99 others); Tue, 10 Oct 2023 15:02:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233336AbjJJTC1 (ORCPT ); Tue, 10 Oct 2023 15:02:27 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C812A93 for ; Tue, 10 Oct 2023 12:02:25 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-9b1ebc80d0aso1022535366b.0 for ; Tue, 10 Oct 2023 12:02:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696964544; x=1697569344; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=5woyaOlfb5FRD/2ky2o7l2Lh0ZKAp5sQQeLB5eexnx0=; b=SwerxqFMedxMTwU4dVCzvaZ8ITJu2hKAQSNz96hao7tkfxBq25l+PD4WkKFj960acV QrLWjpAhPk4wjwufAaiO8JxCGiZbe3eLdZ/te+fTgjR6CpNr67PZ6SmPh9UOTzqOmy4D g2Nwu/BCBd961xfwZWPmP95QoU6+EyIGuncZOnyiBtCJhCj3BpVmXvFfv985gwPQxTxL aG3I3OM4UeFUGH3F0OPuPdoWDGT6eOtrKooLw86aLxLd+BKcAl3hY7MsG9SICKovV2Bg 49Rwf0zKV2nvDjjQ9+dNcaEFtUgHtu46V567eyK1/jwbXaxRp13y/nURh4un+1LZ/mJX qNWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696964544; x=1697569344; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5woyaOlfb5FRD/2ky2o7l2Lh0ZKAp5sQQeLB5eexnx0=; b=qZ1YSCy5yIXnsT1AesW066BNtq/+U8ffIGAoVoGmT+7BmAPkbXo4jDK8vVoMicxwGB O0C0ZWuxX+kjIqMUQJCwAlS4PsMtq1JTlRp3md2K6G3Xonq2QAXlx0tkNOxrTZipO7Ob xMibXZ+PrSWRNBjHWNT/aHxfL2q+M8RZZXopEhWsCgJT44tgMJwaujorB07VNXvlxQO5 efpoZM7mkgoENUcZvDxQ+BVDzujPIgXlIyac2A2xsalsXX3C13dCAS0NFpSuP8g9P4MO GZeJnV1hKDdGH/LxLE0/6TL/yKVsmVJywLMp2qdgYNs8wAGEJevJeJfwduD2gIfH5px7 YIZw== X-Gm-Message-State: AOJu0YxsOHeM++5lrMTJw5Jch7LEt+Ba2MPBfFKnmzqJqLmgo7UzemPw pPtftU3kTaYTr6nxM/yEZ7l9UBY2Ge0AQPQh0Zl0gA== X-Received: by 2002:a17:907:2cef:b0:9ae:6355:5ef4 with SMTP id hz15-20020a1709072cef00b009ae63555ef4mr16422145ejc.3.1696964543989; Tue, 10 Oct 2023 12:02:23 -0700 (PDT) MIME-Version: 1.0 References: <20231010032117.1577496-1-yosryahmed@google.com> In-Reply-To: From: Yosry Ahmed Date: Tue, 10 Oct 2023 12:01:44 -0700 Message-ID: Subject: Re: [PATCH v2 0/5] mm: memcg: subtree stats flushing and thresholds To: domenico cerasuolo Cc: Andrew Morton , Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Ivan Babrou , Tejun Heo , =?UTF-8?Q?Michal_Koutn=C3=BD?= , Waiman Long , kernel-team@cloudflare.com, Wei Xu , Greg Thelen , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.8 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 10 Oct 2023 12:02:37 -0700 (PDT) On Tue, Oct 10, 2023 at 9:48=E2=80=AFAM domenico cerasuolo wrote: > > Il giorno mar 10 ott 2023 alle ore 05:21 Yosry Ahmed > ha scritto: > > > > This series attempts to address shortages in today's approach for memcg > > stats flushing, namely occasionally stale or expensive stat reads. The > > series does so by changing the threshold that we use to decide whether > > to trigger a flush to be per memcg instead of global (patch 3), and the= n > > changing flushing to be per memcg (i.e. subtree flushes) instead of > > global (patch 5). > > > > Patch 3 & 5 are the core of the series, and they include more details > > and testing results. The rest are either cleanups or prep work. > > > > This series replaces the "memcg: more sophisticated stats flushing" > > series [1], which also replaces another series, in a long list of > > attempts to improve memcg stats flushing. It is not a new version of > > the same patchset as it is a completely different approach. This is > > based on collected feedback from discussions on lkml in all previous > > attempts. Hopefully, this is the final attempt. > > > > [1]https://lore.kernel.org/lkml/20230913073846.1528938-1-yosryahmed@goo= gle.com/ > > > > v1 -> v2: > > - Fixed compilation error reported by the kernel robot in patch 4, also > > added a missing rcu_read_unlock(). > > - More testing results in the commit message of patch 3. > > > > Yosry Ahmed (5): > > mm: memcg: change flush_next_time to flush_last_time > > mm: memcg: move vmstats structs definition above flushing code > > mm: memcg: make stats flushing threshold per-memcg > > mm: workingset: move the stats flush into workingset_test_recent() > > mm: memcg: restore subtree stats flushing > > > > include/linux/memcontrol.h | 8 +- > > mm/memcontrol.c | 269 +++++++++++++++++++++---------------- > > mm/vmscan.c | 2 +- > > mm/workingset.c | 42 ++++-- > > 4 files changed, 185 insertions(+), 136 deletions(-) > > > > -- > > 2.42.0.609.gbb76f46606-goog > > > > > > Hi Yosry, > > thanks for this series! We backported it on a 5.19-based kernel and ran i= t on a > machine for almost a week now. The goal was to fix a CPU utilization regr= ession > caused by memory stats readings, it seems that this series was the last b= it > needed to completely fix it and bring CPU utilization to 5.12 levels. > > FWIW, > > Tested-by: Domenico Cerasuolo That's awesome. Thanks for the testing!