Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1598420rdb; Mon, 2 Oct 2023 15:00:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9sFNrJRrdP3rIRgNegAwpyQVvdwut0ygbvwRBCm97+a+a8R2h5zlaTHTczFoV5Kz0pAcM X-Received: by 2002:a17:903:456:b0:1c6:19db:7b69 with SMTP id iw22-20020a170903045600b001c619db7b69mr12474553plb.66.1696284028368; Mon, 02 Oct 2023 15:00:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696284028; cv=none; d=google.com; s=arc-20160816; b=rplhtSB6IhPrl51BlejcgL8kryx7y4xK1ybOKQea8X+vv07litIffsb7/A6J/GsRlq n+QEQrOtmBoeO3SXtMn8AuVDNnpzrxKYZHSZo6gfEnSE6drhzorQay49T/H7Ydb2C/GF nSsidqiBDRvppXBA2zYcOOjj/Fu9RppRUpCd/bwLVYInklX8oSJKoMN2GwDRF32S2IYy R/vUvFpHdsMncIk06FfncJlcgPa1V/De7DhkEw20Yah7H2p+0JdCuT4Et+FQLw4HU4uU ipCMEg3/WYPmQ97+GVJVXSYVLbYJWLv6x8TG0ZyVoMAQY1f2pXaQLSaWsMXNwEEpVLMb tRYg== 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=qUXweOvL2cKobyvxITX1IMrb0VKCh7MXpsaLmhdNmMs=; fh=fR0ks7KU0E9OAGQhM4stF90Ndn/hstpLcD/jlm8G5II=; b=Yx57zYzfaUESJ7ODW9PRJF9M4FK/hmdk1jicR2NCs+1+zklHk8d+LZrdeIleCMeRz2 d5dVplpoQKEsZItstR9mQe1x79MdO6P4m4XwRIiUolsM9SkkvPFLEtMX55x5fx5FJIFH L+YFAgWKUqalQyknViR8SbXCocMy08QnafgIfST5kKlzM9KlpRSY59RWNDZpWEVnuV/t F1yYYeDdWAF58yVOKE0BqchssppcKVhbfB2X+/n0+aUW2CwyYlTotkW1+mYvgAlMIzHM owNl2JxJPxtq4UoGK/HKDu/VLYCX4JsOea1+JYRLTH4Y8zkvh24bIrDoIGSelJDrOCSy Bu8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=GtJjQvSl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id z7-20020a1709027e8700b001c60c5726absi20469595pla.39.2023.10.02.15.00.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 15:00:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=GtJjQvSl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 0E9F880A07DC; Mon, 2 Oct 2023 14:47:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230043AbjJBVrk (ORCPT + 99 others); Mon, 2 Oct 2023 17:47:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229993AbjJBVrj (ORCPT ); Mon, 2 Oct 2023 17:47:39 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FDA3C9 for ; Mon, 2 Oct 2023 14:47:36 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-99bf3f59905so31782266b.3 for ; Mon, 02 Oct 2023 14:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696283255; x=1696888055; 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=qUXweOvL2cKobyvxITX1IMrb0VKCh7MXpsaLmhdNmMs=; b=GtJjQvSle0YSESu2pRvEeDzvIWnQ/iuCljF2hqMDeDrBPq+0P/CDv7s3bv6X3aZTrP ymW1S59OpNz497FqAXBGcy/0hN1BNgLN9I4BE7Td/3tpyJkQiAGURCxCWRNm8WixF+uq r++Qo2k+jIV380yRCXoFeHUf9aYuzqVQh0YUbXV16gZZExqXyTp0hQ/QKkuYXGAXgIDg tmTCgue/H/XoEzOOM3YS1VotX5vv00y/dxUprTpvbAahUAVddBsl2r9edakgG55lj8mC 1Eeu0+yWCyEEUevjuGI+tI1LCkeSRWLWphjmKk3UbF6+Vqihh2fzVWjJtNua89R3shfZ AaLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696283255; x=1696888055; 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=qUXweOvL2cKobyvxITX1IMrb0VKCh7MXpsaLmhdNmMs=; b=FzH3Gf4TkU151iurXEqCfvUzLn+lyqXESQPglp5DLwBAATQ0+2SW6WInXfg0ucvHv5 BDBrXjsMXGY3+s+xDuwwX/kaHHV7JI5xX3/DigNcI/Go7k0WRcvd9JUcV+x0zvVHprti iJmExxd3O2MbtmKMCs2J2DdCfO12XrHrLwTbGi031cvpTeRPvS6QpAXxdziLv4WiYreZ O2tHwTkiSeNgIiJ63RET3c2/HAKI7qL8eTHsd0NZB6l6kc9pH+Zlhpthq/w47Dv4Xutp hrlAn6je23AUUCVxLZkFapWpgOGe3TBL+ecboquOXCMw3yZg9LE7PawKcSnijPO3ycz7 cvFA== X-Gm-Message-State: AOJu0YzyCnqKfnNh8S8AIQDHiVu8I/8w1+1CeLY4sEEf6Yopj+NeCGdt nxkMGkIYlpcJiuBCje3zhzmc0LwRpMOv3Z2KT0td8w== X-Received: by 2002:a17:907:b00d:b0:9ad:c763:bc7a with SMTP id fu13-20020a170907b00d00b009adc763bc7amr10383740ejc.23.1696283254505; Mon, 02 Oct 2023 14:47:34 -0700 (PDT) MIME-Version: 1.0 References: <20230921081057.3440885-1-yosryahmed@google.com> In-Reply-To: <20230921081057.3440885-1-yosryahmed@google.com> From: Yosry Ahmed Date: Mon, 2 Oct 2023 14:46:58 -0700 Message-ID: Subject: Re: [PATCH 0/5] mm: memcg: subtree stats flushing and thresholds To: Andrew Morton Cc: 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=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 02 Oct 2023 14:47:53 -0700 (PDT) On Thu, Sep 21, 2023 at 1:11=E2=80=AFAM Yosry Ahmed = wrote: > > 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 then > 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 v2 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@googl= e.com/ > > 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 | 37 +++-- > 4 files changed, 181 insertions(+), 135 deletions(-) > > -- > 2.42.0.459.ge4e396fd5e-goog > Friendly ping for feedback on this approach :)