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 X-Spam-Level: X-Spam-Status: No, score=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA2C4C48BE5 for ; Wed, 16 Jun 2021 01:10:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3570D61350 for ; Wed, 16 Jun 2021 01:10:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3570D61350 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BD9216B006C; Tue, 15 Jun 2021 21:10:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B88BC6B006E; Tue, 15 Jun 2021 21:10:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A28B26B0070; Tue, 15 Jun 2021 21:10:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0246.hostedemail.com [216.40.44.246]) by kanga.kvack.org (Postfix) with ESMTP id 6F5166B006C for ; Tue, 15 Jun 2021 21:10:03 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id F0544DB39 for ; Wed, 16 Jun 2021 01:10:02 +0000 (UTC) X-FDA: 78257805444.17.17F7C65 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by imf20.hostedemail.com (Postfix) with ESMTP id 217BC371 for ; Wed, 16 Jun 2021 01:09:49 +0000 (UTC) Received: by mail-lf1-f41.google.com with SMTP id p17so1297447lfc.6 for ; Tue, 15 Jun 2021 18:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WkZWfoezrzK3YqSvjNFpximYFS+zPFkT6j8u2nQEHxw=; b=dnZC354fu9ggFFPybBFkrAKpJ+prc+VjiMY0E47wXoZTl70lO0k7nYMjJU+ZV3XOnM cSojlxv0PEOIvvodP7EyyNVyBIDb6VpotqSOH8P7zgKeN99TPu2eM8jtTC5q9GkVMOOm b8n1LUck5mzKRNIURbRp1PAEmcfLJJ6Oofoato99TY3lGZHKhH5BKFQ7LpvdQaSiY3ks 8XqJgWXCw95vBde+156oMa/0O8Vezdj3dFRqsmV65VcAY4q1g4/XaEXHKGuGGv4cDCk7 k59WzkDTvJnW4oE/NZKDqIjt26ezzGMMFYRpxTy8HV6zFdzzlgpdJBhwNO3hKG5oBQ2q Zfxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WkZWfoezrzK3YqSvjNFpximYFS+zPFkT6j8u2nQEHxw=; b=T59Xl+MDbpm2EUztViOokc/G23Q+tww3FsOdwjnVNFQp78AYiIoNrX8pvX5UqLRsdZ dQfdRHUGISmDHvi/LzGwYLhsB4//Fp7EFOQw3Lbijk4JIqtQpG3WqmPOQmtWu6FVcPPc oIWUJDPlJLrrU4et3yM9LmHNXWcQJTzzBiH4Z2tbpWOdoxOPXhRUvLEtU7crDFlOZN4b 8Kt07H6ys2wOczwjvI9w1YgY1hSVUb7h52DiLlB9DRkdhRSciz8InRo/6Om4QaU6nL3n NXyZx3vEjMDYJzzUv8nM+01YHJ5ET3evLSKI4bSA0axisP/4gNCjKLT7T5Os6yQGKmWC o/xQ== X-Gm-Message-State: AOAM530qVvhvWBDiG3Grz7KjpBADird+05AoVg6CYeyxWtjmFRgnTHP9 Z7qqTHmQgtOPUUG0N0o4aZqsoVld0DY8Zp3JNUj2ig== X-Google-Smtp-Source: ABdhPJzf4qJT4TeIuhj5pb3/BNFUHv6br3mhdn2UFHbIAcsSFEWV1evx9ybM06Xaj2HksP1lPhVlQir+fHv+GF9WmyE= X-Received: by 2002:a19:7015:: with SMTP id h21mr1630748lfc.299.1623805800760; Tue, 15 Jun 2021 18:10:00 -0700 (PDT) MIME-Version: 1.0 References: <20210615113222.edzkaqfvrris4nth@wittgenstein> <20210615124715.nzd5we5tl7xc2n2p@example.org> In-Reply-To: <20210615124715.nzd5we5tl7xc2n2p@example.org> From: Shakeel Butt Date: Tue, 15 Jun 2021 18:09:49 -0700 Message-ID: Subject: Re: [PATCH v1] proc: Implement /proc/self/meminfo To: Alexey Gladkov Cc: Christian Brauner , LKML , Linux Containers , Linux Containers , Linux FS Devel , Linux MM , Andrew Morton , "Eric W . Biederman" , Johannes Weiner , Michal Hocko , Chris Down , Cgroups Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 217BC371 Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=dnZC354f; spf=pass (imf20.hostedemail.com: domain of shakeelb@google.com designates 209.85.167.41 as permitted sender) smtp.mailfrom=shakeelb@google.com; dmarc=pass (policy=reject) header.from=google.com X-Stat-Signature: sw84wp3eypxrshr3f69gms9nhfo8xp3r X-HE-Tag: 1623805789-103484 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 Tue, Jun 15, 2021 at 5:47 AM Alexey Gladkov wrote: > [...] > > I made the second version of the patch [1], but then I had a conversation > with Eric W. Biederman offlist. He convinced me that it is a bad idea to > change all the values in meminfo to accommodate cgroups. But we agreed > that MemAvailable in /proc/meminfo should respect cgroups limits. This > field was created to hide implementation details when calculating > available memory. You can see that it is quite widely used [2]. > So I want to try to move in that direction. > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/legion/linux.git/log/?h=patchset/meminfo/v2.0 > [2] https://codesearch.debian.net/search?q=MemAvailable%3A > Please see following two links on the previous discussion on having per-memcg MemAvailable stat. [1] https://lore.kernel.org/linux-mm/alpine.DEB.2.22.394.2006281445210.855265@chino.kir.corp.google.com/ [2] https://lore.kernel.org/linux-mm/alpine.DEB.2.23.453.2007142018150.2667860@chino.kir.corp.google.com/ MemAvailable itself is an imprecise metric and involving memcg makes this metric even more weird. The difference of semantics of swap accounting of v1 and v2 is one source of this weirdness (I have not checked your patch if it is handling this weirdness). The lazyfree and deferred split pages are another source. So, I am not sure if complicating an already imprecise metric will make it more useful.