Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3476742rdg; Tue, 17 Oct 2023 16:53:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHfWvghd26+zp1SVlpV1F8/q2J8nBo3iki8piIqbsC06VbLo7idjxdc/IBSbIAPGKiapbq5 X-Received: by 2002:a25:add9:0:b0:d9b:1545:d785 with SMTP id d25-20020a25add9000000b00d9b1545d785mr3856252ybe.39.1697586782800; Tue, 17 Oct 2023 16:53:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697586782; cv=none; d=google.com; s=arc-20160816; b=LdEMk+K4y1PoMbu132XjUEj0ppVF40mSb8PjjN2VfXvFLFmN2iQLGzSKlzua7Izted rtZFVMnCLKHiRndzkCnB9k3MGKu7cIsE16UXYequdqcaNXWdPrdyMcVDuS2ZihNEfwdU ipQWQrY2Tu9eJRhnE/kmiWemqtCqXonjmWDkVe7QXJEdaiMh7lSluhPf2uvvoKs88IvF d2t67d9gYAi7dUavIFYX+4JdC6LrP3kXoH8E03Wc/ARqDwSI12q/CVJaMRF9VKl3zgbi WfhXtlw1tmo3HPSKQq192KfSOQufbvIyzMkd4IiS3rT02R8K/H00dVxxXhCakDtYKR0T ezNA== 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=8ijNKUZrGV/QasB3HbEVN0PUNmDp0ZQ9fTyJ7U2oDSY=; fh=Rkj2vCQhVLa7SDbU9+Ee4c63pRKBM2Aybg6/zsrz81k=; b=DhW4KcLBjXZmHYrDoigthDXGuKIf1fg/91JY4uv6g7bZz4XfYa8v96awIlVYKNCh2r IgbYymc0TGxKJL5GIkfN6bWNGNj4+rYnnQCvk8HljFpQLpzz6dbGzKvDdevaU7Kcszfy ccBsAb0IMsYa6f5zA0+c7X+kPP1kW+71ovnr6262lr/fNBrgMzfCHvOjlrlI3sNLy358 YEvtV/Xu4HSv5hxFIK8ITyeq/hLEbbGe8VTYhxgma2ddqwCbiVyDo1mCZ8K324GLy8oi InjjJ75d3xcp7RLHVBthbzs4JqgDT6PDktR3bryML9dlP4r4PngeyG+CnRsKVhm5bK9l wvAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=odOFKQKR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id fj29-20020a056a003a1d00b0068fea05ecd7si2733775pfb.164.2023.10.17.16.53.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 16:53:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=odOFKQKR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id B218F80E708E; Tue, 17 Oct 2023 16:53:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344148AbjJQXwv (ORCPT + 99 others); Tue, 17 Oct 2023 19:52:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233700AbjJQXwu (ORCPT ); Tue, 17 Oct 2023 19:52:50 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDA779F for ; Tue, 17 Oct 2023 16:52:48 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-9b6559cbd74so1081679566b.1 for ; Tue, 17 Oct 2023 16:52:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697586766; x=1698191566; 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=8ijNKUZrGV/QasB3HbEVN0PUNmDp0ZQ9fTyJ7U2oDSY=; b=odOFKQKRCbpd6C7Ejnzx3VM1Q6iAxZ3l+kMpObxGf8hjWkvbi19wt0Qwr2c3tiS6D1 LCLCG4k12av6qNtUFvUWXs0XR8jWIfxV9FV7M796lUUcWTYlRrJo4z8wyPl59ONdtVCH GSJ4iEIUzGQBCBEX7y89MxmNou3bumZCH/mkX8Pqn+ZoOBW8yOKQMp/i9WhgPUExS+k8 xP/71emdLGrp+REGBrk9R2c072rp8t4cxyEsWixRfSc8TmtzVM3q+gl9yKDRqogCscqs 2Vaqaer67Smqknbd8kID1v6uZgrqRjE7+jSlOB6ItMXP1X8sJl7t88+sMtZZDUt94W1p WWVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697586766; x=1698191566; 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=8ijNKUZrGV/QasB3HbEVN0PUNmDp0ZQ9fTyJ7U2oDSY=; b=eWZoivA1dSRWpxHrxqgOw7h6p5iVHrYm6PmqPbhX36hM+PwgLoVfHUBlnwS2brYVOU yFaJdOl1v3XCFnsC/XXmOmvslnABueJhfhcJPJ6K5G6xJX5uIw2NNV0PDWwOozmkGXv1 2drkwhL7Q5SW4i97iybrZNPbRw1IcZjzuTeKN7qNJfJDLWQD42IupkVIUxOWXFGZYgRr yL15b29nQSnqwxBmbnWasyatkJpSv6L9fLO//qDHnd2aM1bccB2IR4XcjWXoerEwzQyP I1g5iYqbLcJ9rBu3pmts61JKaQ/3L0lb5iMpAWlwjE4ZIPtgCH3FJb/yz6LNxCxMs/bL 1hsw== X-Gm-Message-State: AOJu0YyzZxiNpSDfDmxcSZRHL8PlORuMfNPcc8rO7YACzCm4tr5CRe3r sTkbJ07qV9PkII1mmmFXntTg9UG72Q1EYh5hzW8FMg== X-Received: by 2002:a17:907:7ba0:b0:9be:ca44:87b6 with SMTP id ne32-20020a1709077ba000b009beca4487b6mr2683655ejc.3.1697586766359; Tue, 17 Oct 2023 16:52:46 -0700 (PDT) MIME-Version: 1.0 References: <20231010032117.1577496-1-yosryahmed@google.com> <20231011003646.dt5rlqmnq6ybrlnd@google.com> <20231014160831.73785b15e9b34eb6146d5497@linux-foundation.org> In-Reply-To: <20231014160831.73785b15e9b34eb6146d5497@linux-foundation.org> From: Yosry Ahmed Date: Tue, 17 Oct 2023 16:52:06 -0700 Message-ID: Subject: Re: [PATCH v2 3/5] mm: memcg: make stats flushing threshold per-memcg To: Andrew Morton Cc: Shakeel Butt , michael@phoronix.com, Feng Tang , kernel test robot , Johannes Weiner , Michal Hocko , Roman Gushchin , 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 morse.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 (morse.vger.email [0.0.0.0]); Tue, 17 Oct 2023 16:53:00 -0700 (PDT) On Sat, Oct 14, 2023 at 4:08=E2=80=AFPM Andrew Morton wrote: > > On Thu, 12 Oct 2023 15:23:06 -0700 Yosry Ahmed wr= ote: > > > Meanwhile, Andrew, could you please replace the commit log of this > > patch as follows for more updated testing info: > > Done. Sorry Andrew, but could you please also take this fixlet? From: Yosry Ahmed Date: Tue, 17 Oct 2023 23:07:59 +0000 Subject: [PATCH] mm: memcg: clear percpu stats_pending during stats flush When flushing memcg stats, we clear the per-memcg count of pending stat updates, as they are captured by the flush. Also clear the percpu count for the cpu being flushed. Suggested-by: Wei Xu Signed-off-by: Yosry Ahmed --- mm/memcontrol.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 0b1377b16b3e0..fa92de780ac89 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -5653,6 +5653,7 @@ static void mem_cgroup_css_rstat_flush(struct cgroup_subsys_state *css, int cpu) } } } + statc->stats_updates =3D 0; /* We are in a per-cpu loop here, only do the atomic write once */ if (atomic64_read(&memcg->vmstats->stats_updates)) atomic64_set(&memcg->vmstats->stats_updates, 0); -- 2.42.0.655.g421f12c284-goog