Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1636pxj; Tue, 15 Jun 2021 18:11:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlfhzZNOyrk52biunMKbpsbNVTxPOp5g/ZXyXgsA8DNWYUztzxlSk2OfRIerCU3TWY8CHs X-Received: by 2002:a92:364f:: with SMTP id d15mr1746106ilf.26.1623805889037; Tue, 15 Jun 2021 18:11:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623805889; cv=none; d=google.com; s=arc-20160816; b=Pperzo/fokl+vwD3TRAeBgVaEDxBk+zZzYwTJQv5gpjWHxGaYlTMtzUNMgYi4x+Ef9 f36WGTIWw7JBB9lSlCLHX9uakjJI8hZkrwMoQnbowPCQMmsmxOQD+2AK/eg4YM6zDxFt vXBIn0Qx4eCStva4mQOoSfwx3jgLypeRLb8BC+5hU/iDsOIy+UXM8MdD0FM1VXU0vCRG 5z0z9g3IA64LOqB+Ey0G3AbvwOYWi2hrr7jQ0AjuslVAKxT4ETqJaGZojtvOYEC4gp6D XOnIt4XZZ6LOm9rXVQok1vcxkjSxQjzcZbn6IMguUskPB5iexshv8/aOQaiYlVz3WF3O vqNg== 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=WkZWfoezrzK3YqSvjNFpximYFS+zPFkT6j8u2nQEHxw=; b=OtRdG2383uwEcU1hFQa3SLnLaWIYzJqzfRIbyDnswheSDF0Dpwt/HPQENdhvlkjzI2 hUc9JG5CdZs+ijgwUFLlD6sm1WFtUiVEsLQBfAZLfoK2esPTuQrQKC4QI//aWKD5ZXIc syf8TphD7sQJ4skJ8DYbs2JZTcaBbLr7WVp1ipgsBMg3L0ml0iCXNQYtmNQgGl2Z9g9/ BF41EreLb/95L+MT5D7L50Fg4hkt5toO+NYlhj+1yKQ9NicO4/QHzXpKzEEUhvorOv0A 9yJoRacsKCSfYPUeItmI/cm8i6HAPOmSR+TThyIBA+2xKzea89hGWZcXNzWWfQflU5ft oUxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dnZC354f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l16si987758jaj.81.2021.06.15.18.11.16; Tue, 15 Jun 2021 18:11:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dnZC354f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231773AbhFPBMJ (ORCPT + 99 others); Tue, 15 Jun 2021 21:12:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229979AbhFPBMJ (ORCPT ); Tue, 15 Jun 2021 21:12:09 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA074C061574 for ; Tue, 15 Jun 2021 18:10:02 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id q20so1333734lfo.2 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=Ows4YthhIhU3NozNaBWYLM9d0QozUvOJTMMj/7KK21DEwvWH7bEjW3c+c+RJQQ/2PX 34/uulwdwr1+v3LiafxUrgozUbgtY3i+Lp/Wy50xN0MmVMJ5gXw4AQfxtThS6T+gDsyk fCrdx6gJHOFpk4Q9ElSya6ykhPrBU8Tt+r03kACg7qH8p9f6+eMcZ9FHha25KAUwmhGK FQ9HN2UyfHyZuJgR0mTleaMqXX57+PtT8pSWmlugUF8RpIRTY0+9zWKMZdtopcICnsDE qFMtC0lFkwpvOc7H7KKq9QaN9ZmVbwyKnsQGuW11XcfRDSIbXIqZ2tiqaJnlvIlM79nw c3fw== X-Gm-Message-State: AOAM530gd2TIwU085ze+MLC67OFkgNAojyyag/Uwu7j9zU12D4RO/7No OUELtEwBVLDZ+D31O0JjQkKslEP8PikRYjqmiWEka/HNd/M= 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.