From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85091C433F5 for ; Wed, 13 Oct 2021 19:24:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 33BC661105 for ; Wed, 13 Oct 2021 19:24:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 33BC661105 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 969EA6B0073; Wed, 13 Oct 2021 15:24:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 918E96B0074; Wed, 13 Oct 2021 15:24:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 80822900002; Wed, 13 Oct 2021 15:24:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0045.hostedemail.com [216.40.44.45]) by kanga.kvack.org (Postfix) with ESMTP id 727186B0073 for ; Wed, 13 Oct 2021 15:24:45 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 2223127705 for ; Wed, 13 Oct 2021 19:24:45 +0000 (UTC) X-FDA: 78692391330.04.849DB8E Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by imf16.hostedemail.com (Postfix) with ESMTP id 6BDBAF000090 for ; Wed, 13 Oct 2021 19:24:44 +0000 (UTC) Received: by mail-lf1-f50.google.com with SMTP id j21so16760546lfe.0 for ; Wed, 13 Oct 2021 12:24:44 -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:content-transfer-encoding; bh=OcVw8ovBCZVOoCHV49LU9UJr7n1pv24bvXfSbF9CliM=; b=spTehBDgwgxtAT5s4zEyEzdavxm/I/DtmCIdVIVhZeouKvynu2a3SSRGv2kSQLqT1K I39IIC9a59bpOtvUMiPw5D8FnlNU8xvsp+JppFy07dv5mRlOnsqU87Al5n8LybTZHcDD vSFYTHwK5kNMRUcSvts5fuPzG2AUMWSuCMG52e8mGTwyYBDx1rAJi+kZhIu0AS20m4mW EHLfDzWt2InVuusPhroF1IGYYVVqy1VJrL4walMelIL/ih2NPNGT9u5/BNXIJFWDYwiH V6z0GrBuZYx+hHxo+7M84CzO9P9HEU79eMisNKW6ORHFm9Biu8v/RlbVgm+ODvHFINk+ rN1Q== 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:content-transfer-encoding; bh=OcVw8ovBCZVOoCHV49LU9UJr7n1pv24bvXfSbF9CliM=; b=pb4UkXHfHsqOa9NPBXIRlBPyQ70YtHzVg+36Nz6rh3FINclmG/veWvhQNaIopXQAj9 eL1OOg2qbRwApl9oKXbg7x/cJJ6d+rLZn/18cAk6gfXU/liwApC7wK25xK4b1NpTUPeb 2H2yn+ab7ggom8XWTwan8s85gWZ2gS5uNJVmT22F1KzyQjqzpbL+f7E9pqqL5pyUIXgB VGQV0RSyj4Gb2Ab7lHAS1d9tMzcsoh3u+jgBAkqDg1Lt0dvm6Vh7oymTkUChlklbzdN2 RVO5/2PcMsn4oB3DVWvs40u8pHPTuFUFnNfXDio2EM1LviNnDjwTpEZmKzCh7oPYGNBZ zG6A== X-Gm-Message-State: AOAM530R2vWNvp+ksnPGKWNA7wJHEqBowr8dKmyXzylLb4qvQPHHX1Ze BpwBlXlmK7vofgjJhRO28jEI12OoqUmKCNI6CrKjoQ== X-Google-Smtp-Source: ABdhPJxHS51cV0uhO42k3Hh0LtZ1R7GCobDDAlublLaFoZOcD9wkHJnk8ZUeFVAgfhmgNRh0GzhaEgTs2Qw7kDxahQk= X-Received: by 2002:a05:6512:131b:: with SMTP id x27mr807634lfu.210.1634153082922; Wed, 13 Oct 2021 12:24:42 -0700 (PDT) MIME-Version: 1.0 References: <20211001190040.48086-1-shakeelb@google.com> <20211001190040.48086-2-shakeelb@google.com> <20211013180122.GA1007@blackbody.suse.cz> In-Reply-To: <20211013180122.GA1007@blackbody.suse.cz> From: Shakeel Butt Date: Wed, 13 Oct 2021 12:24:31 -0700 Message-ID: Subject: Re: [PATCH v2 2/2] memcg: unify memcg stat flushing To: =?UTF-8?Q?Michal_Koutn=C3=BD?= Cc: Johannes Weiner , Michal Hocko , Andrew Morton , Cgroups , Linux MM , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 6BDBAF000090 X-Stat-Signature: mbobg3iwtx9dina876o75quixg8comw4 Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=spTehBDg; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf16.hostedemail.com: domain of shakeelb@google.com designates 209.85.167.50 as permitted sender) smtp.mailfrom=shakeelb@google.com X-HE-Tag: 1634153084-667231 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Oct 13, 2021 at 11:01 AM Michal Koutn=C3=BD wrot= e: > > Hello Shakeel. > > (Sorry for taking so long getting down to this.) > > On Fri, Oct 01, 2021 at 12:00:40PM -0700, Shakeel Butt wrote: > > There is no need for that. We just need one flusher and everyone else > > can benefit. > > I imagine a cgroup with an intricate deep hiearchy with many updates and > a separate (simpler) sibling/independent cgroup that would need to pay > the costs of the first hierarchy updates [1] when it asks just for its > own stats (bound by the amount that's leftover from the periodic > updates). > > The stats files (or wb stats) are likely not that time sensitive and the > reclaim (that can be local only but is slow path anyway) already uses > the global flushing. > > I wonder whether the bigger benefit would be to retain the global > stats_flush_threshold counter but flush only local subtree. I did contemplate on this (i.e. a stat read paying the flushing price for everyone else) but decided to keep as is based on: 1) The periodic async flush will keep the update tree small and will keep infrequent readers cheap. 2) Keep things simple for now and come back if someone complains for very frequent stats readers. Shakeel