Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1215122rwb; Wed, 26 Jul 2023 09:07:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlFaC/+pKQmkUlA/zsW+gbxu1dRCtPY7j4lxvtudwX2eUlU1Ry5PCni97RkUGg8SY0ifuEBW X-Received: by 2002:a17:902:7006:b0:1b5:1467:c4e8 with SMTP id y6-20020a170902700600b001b51467c4e8mr1648178plk.15.1690387671623; Wed, 26 Jul 2023 09:07:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690387671; cv=none; d=google.com; s=arc-20160816; b=PlgJydYKsLvIveQkun9wR+NBSWsB+iLqA46thGLNMtscEpKX2TZ1oGlB1Q40y6JRpC fIrMbZp/Zb9dPP768x5nOpl78B9pK3jKEytcSp2BFVGbD/K/bS12oofvegSpHN8cf5rA SlsYVhKKaAKy/t3q/o69bqvDX413nJItgvTJdAa3TiE6M3mBc+2Ogy5YekU1vegFqb+7 O8X3TZ0UF29NdYPvCZLO+b6Y7Sh8yGLjl6EwD6P6/271QMZE4jpzbD5koUzh3084vC/p l8Uslz5+41JUA8shsfBPN2QbL2J+4OUaKdoCbHeX0u4T10tBPMzfKC6IBdZ1zasfZGXz 5BfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=TR6oQPY6JNSBn86BXUT6Jb7RsPiu2t8ttrP3Qk1ckmA=; fh=z1lu8x4eN00igH2uoRfVQK93eni+irpLsMSee7dzNdo=; b=uJwRP+9UEHr9qChQctR9STTc+T82Ft9vCKS1x38IBJ7ktYwC1ZYW4JEhx2H/zF6wOn UGMaovbag9kAXDeCXtjB+WKp7ho86hVkqTGNTt7jJzehuWr9Wzy7sgOYzfGZY/x5o3+x Vv75CuMfdh+7Kt1DANuNPvJShqbtketq8RDvMRLvXbxrozelI2MSqQEN9uCJa/bQIafC 5e7QDtXQb/bzVYoIiVkHM7I+7JI9gD3UMaDUH+9rcVJOv/Mm2hmUyOubmICVARY9gJHv /BP+JzAf8EF/BETeiXECiWAdnqZsZGyqlPgE6NTvhnjiwwJb+KX7HQ4muqxfexB21IY2 mJrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20221208.gappssmtp.com header.s=20221208 header.b=kEYIf12W; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cp1-20020a170902e78100b001b81a112f9bsi2512295plb.586.2023.07.26.09.07.38; Wed, 26 Jul 2023 09:07:51 -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=@cmpxchg-org.20221208.gappssmtp.com header.s=20221208 header.b=kEYIf12W; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232786AbjGZPVB (ORCPT + 99 others); Wed, 26 Jul 2023 11:21:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231370AbjGZPU7 (ORCPT ); Wed, 26 Jul 2023 11:20:59 -0400 Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA54AE77 for ; Wed, 26 Jul 2023 08:20:57 -0700 (PDT) Received: by mail-qk1-x72f.google.com with SMTP id af79cd13be357-7656652da3cso523044185a.1 for ; Wed, 26 Jul 2023 08:20:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20221208.gappssmtp.com; s=20221208; t=1690384857; x=1690989657; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=TR6oQPY6JNSBn86BXUT6Jb7RsPiu2t8ttrP3Qk1ckmA=; b=kEYIf12WH7QjPdNoSCv0WUSbARvQjmtVxX7NfaQzrYxV1/+nRefphJ/BTVVpb3PI3k tDFiu/YtGXzrb7LxUR36pX2VIcIE4gHAqkuNB3cwZSL76h5iTQjva8lKEpiF5mixmS9j zB/QcNjxJqpZs0gjpSEB7cQ4TxsEnvvfcOAkvF72PHHpzXrX5hHIncAuMkUoFmSw29aN JZcwXccKyQocpVHQG72luYQIe6XFkG0KPfRT9NwyYpkFvDisRm1YB/A5Egv0H0ixL38b OZ54MHmoHTmvqEI8a/dnmJJEjpzdkkfjyjwLJuB4INwzRuRMAb3gXkjvoN4j4vRJw8KA vfGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690384857; x=1690989657; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TR6oQPY6JNSBn86BXUT6Jb7RsPiu2t8ttrP3Qk1ckmA=; b=LrYBl05vrNXPTkCpF2/b+4z67bGVo1k4eGV7/3VwvxS8DiA/Hn9wJXLd+QmC5CZTcy cjDrJ7yRHkdtQDwIA5NlNioFJJSGmWLsQkt8PgWjMVUddXz1pq8ec2jIK/g5pmrjyrPN WO5A5U0R6mKOQ/83azmPqZPgm/+aad+WMWsT+rwERqbku7PwdaHBNJQVvMrKLyYo+dG4 J4mcDYcOH4aJ37ez4D0guJXS7Z7xMIArkxx6l6M9mA9tD0fqx4k1sSIb8XCnbcjjebzx cuAy2el2pgOzuIyw/g3sUuHcQEtCQHRM1PG+39g1ghUjNOqcxgvK4/fdDvGHp0Lz8KYZ kU6Q== X-Gm-Message-State: ABy/qLbji8OlvEsdX8wMuFqyZ2WS2OIHfNT6b4Th3tfvkWwb7raRfQmI rOCQg0rH5M/SeSvG0KnzBbBP6NVsXCsT7gGpha52VA== X-Received: by 2002:a05:620a:450d:b0:768:125c:cded with SMTP id t13-20020a05620a450d00b00768125ccdedmr3115630qkp.14.1690384857073; Wed, 26 Jul 2023 08:20:57 -0700 (PDT) Received: from localhost ([2620:10d:c091:400::5:ad06]) by smtp.gmail.com with ESMTPSA id g12-20020ae9e10c000000b00767291640e8sm4424608qkm.90.2023.07.26.08.20.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 08:20:56 -0700 (PDT) Date: Wed, 26 Jul 2023 11:20:55 -0400 From: Johannes Weiner To: Yosry Ahmed Cc: Roman Gushchin , Michal Hocko , Shakeel Butt , Muchun Song , Andrew Morton , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2] mm: memcg: use rstat for non-hierarchical stats Message-ID: <20230726152055.GC1365610@cmpxchg.org> References: <20230726002904.655377-1-yosryahmed@google.com> <20230726002904.655377-2-yosryahmed@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Tue, Jul 25, 2023 at 07:20:02PM -0700, Yosry Ahmed wrote: > On Tue, Jul 25, 2023 at 7:15 PM Roman Gushchin wrote: > > > > On Wed, Jul 26, 2023 at 12:29:04AM +0000, Yosry Ahmed wrote: > > > Currently, memcg uses rstat to maintain hierarchical stats. Counters are > > > maintained for hierarchical stats at each memcg. Rstat tracks which > > > cgroups have updates on which cpus to keep those counters fresh on the > > > read-side. > > > > > > For non-hierarchical stats, we do not maintain counters. Instead, the > > global? > > Do you mean "we do not maintain global counters"? I think "global" is > confusing, because it can be thought of as all cpus or as including > the subtree (as opposed to local for non-hierarchical stats). "global" seems fine to me, I don't think it's ambiguous in the direct comparison with per-cpu counts. Alternatively, rephrase the whole thing? Something like: "Non-hierarchical stats are currently not covered by rstat. Their per-cpu counters are summed up on every read, which is expensive."