Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1265784ioo; Fri, 27 May 2022 05:18:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwU+4Wf1Kuoc7jo68/Art8HtkEHp7vqPtjq8izLqMXt771ddhrDwGdsTzkIty75owXlLMKt X-Received: by 2002:a17:907:7811:b0:6ef:a896:b407 with SMTP id la17-20020a170907781100b006efa896b407mr37518388ejc.645.1653653883083; Fri, 27 May 2022 05:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653653883; cv=none; d=google.com; s=arc-20160816; b=P+3ZvWXBTXkDW6dfbBSkXCqta+bxg/CxmDlQvUMTIvQiQ8FzOof4MUiZZDH0V/lIK8 TLP9Cj8BEO6MQ1NovSV5eZgV3BTWNzD4mRTJATGzneczdfV+V8JwiQtYnaR/bKv2FcjV 1yl2+3TI7lLMIRgUJKqCn3abcCQR/Zj2KdyHSQuBiVrO/qxWA1INbl/ya3x3nMoTWRh2 tcqNmCowFup1Cqoh4r0M/Rg8nXDCuvWK38JLrVcXqDNMp7EhkdgLDHkS1J9bya836xn9 mL+1VEe06fpiRLVe8S0C7qrLiiTrmWDSP0Lp9HWbK07Dy3BZX+do2I05oV75ZGmiRxHJ 8FNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=A0dEd4NUNMrTRFFSR3+OfkYzmb9W3Zxpow0f09EOgls=; b=VVL5xzXLtEKeGAQ1q5vvwCW7qNnIpCNBCCgZuKxDHF5cg2PeM605B19AD11SeAF2xO 5G0GK2tgxFAvtpRWZXNXXfnm2EIjpvu8JxCOHDNd4xx4fQ9ux51iCj03hxkXiD8gX3ZI YfimxHN9/5dZUR+hq8RvE5CYObmBMhmyySqgC+LZvYdUxfUyBfH9Zx9jkXKwxV0nA5KT JHWN3P0sGW3YKiyFyQkJTzgXHC/9ZAivlFdk9rGPgRQKTJGc0LV6s//bArJZEt34rVRJ 2bIH31PhrVC2aHwYXBmE9uPVsrkuetKnPlgNH+wtrQabJb143NozOupiuW+QCmK8nEBI /OCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=s5IkQauZ; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js8-20020a17090797c800b006f373cb5815si4936155ejc.979.2022.05.27.05.17.35; Fri, 27 May 2022 05:18:03 -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=@google.com header.s=20210112 header.b=s5IkQauZ; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233685AbiEYUc1 (ORCPT + 99 others); Wed, 25 May 2022 16:32:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231211AbiEYUcW (ORCPT ); Wed, 25 May 2022 16:32:22 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBCA31583D for ; Wed, 25 May 2022 13:32:20 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id x12so7378643wrg.2 for ; Wed, 25 May 2022 13:32:20 -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; bh=A0dEd4NUNMrTRFFSR3+OfkYzmb9W3Zxpow0f09EOgls=; b=s5IkQauZnOLISvCoz7A9uhGFFCaH1f6gh+yufCmj+HN/vMS6luKtssU9qd7rvuHP09 HhINtg7TpvcOmZm1ouHcVkjKk6zEEeNeWY6nO4yudTi3fchpTd2jAQqb7M+Nqsts4Yl7 iU8Hbk1kY75EEpSOU6r93DqrrMnxdh+0P0FaPzPHtty0hvs+DnUoYHaN0FJ8JZvzSoqy 3Q8c8fxts4s9EzUn+2U1k5GK3ykGZ9PNN1dkeb+A9fBG9SRLbEsFSjaOXJdyhkQ5EpFr 5OFDAMcBoiBF7XQQZ+WFPEM44Gcr2BZC20P7JgeRPoHbwD64VcWUoQXv3RdTO+wXTsYy iKYA== 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; bh=A0dEd4NUNMrTRFFSR3+OfkYzmb9W3Zxpow0f09EOgls=; b=S6Hpm4LPb2+ZsonTY5VpsiQnHrRlzh2P0DBWfjpQcI/YMNeK98O5yOSSE1cNwiXQ1q MfI8W5UMPpGkTT8ppsIAXHLs7E//Sd2dvhM7TlgzWVpuPmd5gzq5BDF65XuLx2WLO0hD CgwHPu0qsks8pXB6LldIAvjkWhawlT4CmICmc6kREw+BCe/CwNUej76Epyzf8eApiTHy VLUjVBNywFnHeTCch5gRLX3sfTAenZvmXj0HMFULyzrRhKcVXvG2VRuN576TKDSYOxbz SZe7g+JvvI5EuKiZ5XqBoXz3RNhC410zsMbUJwVsmCaXemgw01MbK/nTwXLDOeklji/p Yhqw== X-Gm-Message-State: AOAM530g3VL3vs3FhYuAOLFPkF7EsV3EQg+NC1pNdeCKjFkhL9+xm/ZS 2dI8SO6nsM1BeZF5Zg8ccRvXypRfly3eQ2vk4aSf0Q== X-Received: by 2002:a05:6000:544:b0:20f:ca41:cc4c with SMTP id b4-20020a056000054400b0020fca41cc4cmr18728082wrf.582.1653510738811; Wed, 25 May 2022 13:32:18 -0700 (PDT) MIME-Version: 1.0 References: <20220518223815.809858-1-vaibhav@linux.ibm.com> <87zgjcg4xs.fsf@vajain21.in.ibm.com> In-Reply-To: From: Yosry Ahmed Date: Wed, 25 May 2022 13:31:42 -0700 Message-ID: Subject: Re: [PATCH] memcg: provide reclaim stats via 'memory.reclaim' To: Michal Hocko Cc: Johannes Weiner , Vaibhav Jain , Cgroups , linux-doc@vger.kernel.org, Linux Kernel Mailing List , Linux-MM , Tejun Heo , Zefan Li , Jonathan Corbet , Vladimir Davydov , Andrew Morton , "Aneesh Kumar K . V" , Shakeel Butt , David Rientjes Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham 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 Wed, May 25, 2022 at 1:59 AM Michal Hocko wrote: > > On Tue 24-05-22 12:01:01, Yosry Ahmed wrote: > > On Tue, May 24, 2022 at 4:45 AM Johannes Weiner wrote: > > > > > > On Mon, May 23, 2022 at 03:50:34PM -0700, Yosry Ahmed wrote: > > > > I think it might be useful to have a dedicated entry in memory.stat > > > > for proactively reclaimed memory. A case where this would be useful is > > > > tuning and evaluating userspace proactive reclaimers. For instance, if > > > > a userspace agent is asking the kernel to reclaim 100M, but it could > > > > only reclaim 10M, then most probably the proactive reclaimer is not > > > > using a good methodology to figure out how much memory do we need to > > > > reclaim. > > > > > > > > IMO this is more useful, and a superset of just reading the last > > > > reclaim request status through memory.reclaim (read stat before and > > > > after). > > > > > > +1 > > > > It might also be useful to have a breakdown of this by memory type: > > file, anon, or shrinkers. > > > > It would also fit in nicely with a potential type=file/anon/shrinker > > argument to memory.reclaim. Thoughts on this? > > Can we start simple and see what real usecases actually will need? Agreed. Let's start with a single proactively reclaimed memory stat and then add subcategories if/when needed. > -- > Michal Hocko > SUSE Labs