Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3658156ioo; Wed, 25 May 2022 05:35:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwx3cTd9GUAtME5nGlUvemTYyAO1yqDUuzPF/s5Rn8gi+Ha9q7wEVPOq485OYF/IYOaOwH0 X-Received: by 2002:a17:906:f17:b0:6fe:94f6:cb8a with SMTP id z23-20020a1709060f1700b006fe94f6cb8amr27821775eji.456.1653482120151; Wed, 25 May 2022 05:35:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653482120; cv=none; d=google.com; s=arc-20160816; b=EPONSqf8P2cZz7TEyZgntbmgM7AttEubyPifM9flLkRU3mwwJzKJAF9flpzLHRv0II J9tXMVsx8cEWM5wd1MMVtFGuywt8/IJy83nXjkAgf/CBr9JI61fvJ+mv1FnfFrMRS3w9 cVdNG0jbIeyl66uHOe1pmmFnNjaZfzTyoAnaopCqXUdlefrUIsbw2AWZ7bfpG1yjVpBZ /DoK1Zxju3jfsnUomG9aBxzvXTAEtqUFpRAgqQHNQCvl00R0tE+gKRUMExMFeI0085Uj a9EwKc4JoSJGf7kOD5yo4asUOB0w+tIq8a4SVdOY81GoV6lITD6oylTOwjxV4XfQPfyh R7XA== 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=zPoBKVvC2etY1rrj+YwE9RcWhQO3Aeb8jFG7VSlxgGE=; b=wOPjf7L0HEt5J1D4ulebcHcitknBr8X9D00srsv1/uSUEuNVdaC0IWUB/FbFm88qtO 5haVl79ndJZ+hMkoHny1DYP9GDyCoooyeeQhvEL+wU7mPsy8gkO4YRSdQYC5+NMSDy1Y lj7eGQmJIjXv/Tuim01qEaRAO3yKWrygxKl0aWJpJ+kUINLbofKU+WHYRz28iiuzmUIu UMnBMYEiFCpJ4khGNnrPFK8+OpNgqK1ds63/U3ZDQrJUwSwiFVwnw/DnszsSScW25Ey1 Re8S0czIlwzU5F1ASSA4j5M+iXE6XaHciL40hDg0Fb467x4rYm0L9mHerBCI2pIPnM9y DEhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=eShZOTIU; 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 gn12-20020a1709070d0c00b006e7fe1e4eb4si19894199ejc.847.2022.05.25.05.34.50; Wed, 25 May 2022 05:35:20 -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=eShZOTIU; 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 S240837AbiEXTDy (ORCPT + 99 others); Tue, 24 May 2022 15:03:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235655AbiEXTDR (ORCPT ); Tue, 24 May 2022 15:03:17 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C75EE9E9FD for ; Tue, 24 May 2022 12:01:44 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id f2so27073116wrc.0 for ; Tue, 24 May 2022 12:01: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; bh=zPoBKVvC2etY1rrj+YwE9RcWhQO3Aeb8jFG7VSlxgGE=; b=eShZOTIUQ93TOWjEzr249Q2WlZgXfVBXRXVkiPqqzxHc3weu9dWI5q3Ho56xWalhYm DNCo2rp9rMlgNBrK8z0XY/wW3LtOYML1vS+M+JPqvzdBIyhIp4u0EN07gBXsnOV6nri8 362c3np7lTLklsZKcOFMwfRRupNLAPynTYIAwR6xjCdZj/A/gIhF1Qfk1QwtUz1zpdDg OwP1XDrZlsnRRXavqft/ReWGqQnEA11Wn1yavd6amKib47Nc170P/orJbWp9qtErNk/7 CisGNh6vWRjQoZRymrDq8S4Qa8rADzUXLl566tiu679wuf5A6NCGy//TjeVsXiZq3cdx FakQ== 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=zPoBKVvC2etY1rrj+YwE9RcWhQO3Aeb8jFG7VSlxgGE=; b=YSqhioswJ8djXbJ/vkRpMpbxN6AD6f0TrnGSOW4Y1DJHZPsbroiWxaYbUkveAxptzh hOpcI/eYg6sI7sZ+kDoD4+AN4Mth+D1HUFj0EQTwjN2i5Toemd1UrvK8+1KflXwsaPiP g4HFyNffoVCOTUvhbcy/yRB7zTJV9ArDR4Ndl0KgbT1eYwNcc5w7TZxM3a0wrEwHbLkW Ll5ueyktjGYjRvTqsZfUOjnBbHD+CB5DGp0t+2+4z+7g+k+Kp1dKjw7bwm8dkjnKH3bD zrvIFMTjPfBScnq6e2bowxGA9Exq6GDuCCn+kf2kgnhnBl3AQQyvimMqYoiNKj/U+Z1n t/Fw== X-Gm-Message-State: AOAM532mbaBqFa0qs2JqkAOfvJESLEIALbBpen8KuO5knwLB8pArmo0u rXJBHKqx6BNFYd1FY891C2DIJNBfJo27chBrDLH9Ow== X-Received: by 2002:a05:6000:1548:b0:20f:c4bb:defd with SMTP id 8-20020a056000154800b0020fc4bbdefdmr15202675wry.210.1653418898448; Tue, 24 May 2022 12:01:38 -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: Tue, 24 May 2022 12:01:01 -0700 Message-ID: Subject: Re: [PATCH] memcg: provide reclaim stats via 'memory.reclaim' To: Johannes Weiner Cc: Michal Hocko , 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=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, 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?