Received: by 10.192.165.156 with SMTP id m28csp2050056imm; Thu, 12 Apr 2018 07:50:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/KRYiv7hJ3wAppPri10lDVX1/iX+z8qQDtkKgkjeX6Ue5GPaQ1R2mSDA6oC0zYi6Pmsn+1 X-Received: by 10.98.89.23 with SMTP id n23mr7931606pfb.211.1523544619879; Thu, 12 Apr 2018 07:50:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523544619; cv=none; d=google.com; s=arc-20160816; b=JtYJ6+ktFp7hGlJ/lrdYWFrTpGAjelD3FvKvDgbmcIOxdwzgbHXIXbmUne+98AzYYi 5qILEnLZjeOZlSaU9lROw3M8hJefGW8HK5+sx5KT9DFGDH0J81u/plh+XbmwukbWiaPx 4AJKCJiscvLs7TeTeZGHNAUN+N863F7+wQpNMgr5KZs64z01hw2x6DQUM7zfr4oBmXSo nXsMtdxLsSusq0hzNGGtNmpMuJqx5dLfFvPIHs63vR+Ijjjfystbi68es4dRyCC8JfI0 fVY3NGXiuvQp30GnW9qskLxVbTAhlWCsTQBMxxvGwnyre68gczNXXe35BLyce5+YZSGB 931w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=QnWqh1nkGf+9ZTMWRFHZ2hM0fthTyOI5ZVpql57xhiE=; b=hwit0q8IAxPNCuJyK4z4EvGP0Yaw4lqWhX6oEfAdszUPn4CenUBJzlG51N/uBSji3Z IS0FMPhyBvlwL8SWaU3wbtUz1n48S5gB0C5JHC4TGizYpk5nBUF/PgMrx0f4VLZTwp72 7RRt7O9557jE1SC/mwZCXglRSH1tu+cE6buzsh25nsMOMvMDIUvqd2K+220yMCZBnlYE wtNcTE8AvxDMQFTylAnCMwvRicraYyOPkfHcTCRT36YQu8oZqt5+NbxH2QBEVQHtpdyy ajfEiwnRABDjJlDIW0I0eJFfgNobMOr6HDIytVlkvpnDymx6jMBlzwbbag5pC1kjV666 ucKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j22-v6si3487691pli.712.2018.04.12.07.49.42; Thu, 12 Apr 2018 07:50:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753124AbeDLOq4 (ORCPT + 99 others); Thu, 12 Apr 2018 10:46:56 -0400 Received: from mx2.suse.de ([195.135.220.15]:45667 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752355AbeDLOqz (ORCPT ); Thu, 12 Apr 2018 10:46:55 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B84DFAF23; Thu, 12 Apr 2018 14:46:53 +0000 (UTC) Date: Thu, 12 Apr 2018 16:46:51 +0200 From: Michal Hocko To: Roman Gushchin Cc: Vlastimil Babka , linux-mm@kvack.org, Andrew Morton , Alexander Viro , Johannes Weiner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, Linux API Subject: Re: [PATCH 1/3] mm: introduce NR_INDIRECTLY_RECLAIMABLE_BYTES Message-ID: <20180412144651.GI23400@dhcp22.suse.cz> References: <20180305133743.12746-1-guro@fb.com> <20180305133743.12746-2-guro@fb.com> <08524819-14ef-81d0-fa90-d7af13c6b9d5@suse.cz> <20180411135624.GA24260@castle.DHCP.thefacebook.com> <46dbe2a5-e65f-8b72-f835-0210bc445e52@suse.cz> <20180412115217.GC23400@dhcp22.suse.cz> <20180412143826.GA30714@castle.DHCP.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180412143826.GA30714@castle.DHCP.thefacebook.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 12-04-18 15:38:33, Roman Gushchin wrote: > On Thu, Apr 12, 2018 at 01:52:17PM +0200, Michal Hocko wrote: > > On Thu 12-04-18 08:52:52, Vlastimil Babka wrote: > > > On 04/11/2018 03:56 PM, Roman Gushchin wrote: > > > > On Wed, Apr 11, 2018 at 03:16:08PM +0200, Vlastimil Babka wrote: > > [...] > > > >> With that in mind, can we at least for now put the (manually maintained) > > > >> byte counter in a variable that's not directly exposed via /proc/vmstat, > > > >> and then when printing nr_slab_reclaimable, simply add the value > > > >> (divided by PAGE_SIZE), and when printing nr_slab_unreclaimable, > > > >> subtract the same value. This way we would be simply making the existing > > > >> counters more precise, in line with their semantics. > > > > > > > > Idk, I don't like the idea of adding a counter outside of the vm counters > > > > infrastructure, and I definitely wouldn't touch the exposed > > > > nr_slab_reclaimable and nr_slab_unreclaimable fields. > > > > Why? > > Both nr_slab_reclaimable and nr_slab_unreclaimable have a very simple > meaning: they are numbers of pages used by corresponding slab caches. Right, but if names are reclaimable then they should end up in the reclaimable slabs and to be accounted as such. Objects themselves are not sufficient to reclaim the accounted memory. > In the answer to the very first version of this patchset > Andrew suggested to generalize the idea to allow further > accounting of non-kmalloc() allocations. > I like the idea, even if don't have a good example right now. Well, I have to disagree here. It sounds completely ad-hoc without a reasoable semantic. Or how does it help users when they do not know what is the indirect dependency and how to trigger it. > The problem with external names existed for many years before > we've accidentally hit it, so if we don't have other examples > right now, it doesn't mean that we wouldn't have them in the future. > > > > > > We would be just making the reported values more precise wrt reality. > > > > I was suggesting something similar in an earlier discussion. I am not > > really happy about the new exposed counter either. It is just arbitrary > > by name yet very specific for this particular usecase. > > > > What is a poor user supposed to do with the new counter? Can this be > > used for any calculations? > > For me the most important part is to fix the overcommit logic, because it's > a real security and production issue. Sure, the problem is ugly. Not the first one when the unaccounted kernel allocation can eat a lot of memory. We have many other such. The usual answer was to use kmemcg accounting. -- Michal Hocko SUSE Labs