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=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 63AACC433B4 for ; Tue, 20 Apr 2021 14:52:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D1285613C9 for ; Tue, 20 Apr 2021 14:52:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1285613C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2D4D06B006C; Tue, 20 Apr 2021 10:52:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2AB736B006E; Tue, 20 Apr 2021 10:52:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 14CAC6B0070; Tue, 20 Apr 2021 10:52:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0032.hostedemail.com [216.40.44.32]) by kanga.kvack.org (Postfix) with ESMTP id EC2116B006C for ; Tue, 20 Apr 2021 10:52:02 -0400 (EDT) Received: from smtpin40.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 9F6E5181AEF1F for ; Tue, 20 Apr 2021 14:52:02 +0000 (UTC) X-FDA: 78053035284.40.EFDFA5E Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf27.hostedemail.com (Postfix) with ESMTP id 2597F80192E7 for ; Tue, 20 Apr 2021 14:51:46 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 0F3F6613C9; Tue, 20 Apr 2021 14:51:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618930319; bh=JpMF49XQzCztEq9qBMVVUAhpIKrxlZMr9gtph/RDnns=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DFmiGYcWMxauOWy6nBp2DbEzQ4/Xd2/5MxCZjp7sIXR8Jy8f/RuJuQIEcZUjdnBy5 cDcWJizyqC0jjXKNVsGTb7Mrxm0DoRe/ADAdMPTwOOfOeWUUhZvp/DX5Mwup7+I9zT LVn6zAFbBX+s4dCDXHAn2uRg0r6gx5zZYrsRkseFAeMVqeYd775KFeLnYGUELNtooA DVGWt6hWJSLO4/2adeHw2m4ibJQ7BcEvtGY4Bb0zqU6Xp0JZwndJvbYM70qvAEr6kb qHiYsPq0vGLpoRO/OzM1zKg8EpbKOCU8r501caYB5funvMAHPHuAeewYToxShXs20D L4woI7RPg/MzQ== Date: Tue, 20 Apr 2021 17:51:51 +0300 From: Mike Rapoport To: Matthew Wilcox Cc: Jonathan Corbet , Alexey Dobriyan , Andrew Morton , Eric Dumazet , Michal Hocko , Mike Rapoport , linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org Subject: Re: [PATCH v2] docs: proc.rst: meminfo: briefly describe gaps in memory accounting Message-ID: References: <20210420121354.1160437-1-rppt@kernel.org> <20210420132430.GB3596236@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210420132430.GB3596236@casper.infradead.org> X-Stat-Signature: 9gfxxr73ta9wdzsooymy6yn5nngsgo4c X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 2597F80192E7 Received-SPF: none (kernel.org>: No applicable sender policy available) receiver=imf27; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1618930306-226850 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, Apr 20, 2021 at 02:24:30PM +0100, Matthew Wilcox wrote: > On Tue, Apr 20, 2021 at 03:13:54PM +0300, Mike Rapoport wrote: > > Add a paragraph that explains that it may happen that the counters in > > /proc/meminfo do not add up to the overall memory usage. > > ... that is, the sum may be lower because memory is allocated for other > purposes that is not reported here, right? > > Is it ever possible for it to be higher? Maybe due to a race when > sampling the counters? > > > Provides information about distribution and utilization of memory. This > > -varies by architecture and compile options. The following is from a > > -16GB PIII, which has highmem enabled. You may not have all of these fields. > > +varies by architecture and compile options. Please note that it may happen > > +that the memory accounted here does not add up to the overall memory usage > > +and the difference for some workloads can be substantial. In many cases there > > +are other means to find out additional memory using subsystem specific > > +interfaces, for instance /proc/net/sockstat for TCP memory allocations. > > How about just: > > +varies by architecture and compile options. The memory reported here > +may not add up to the overall memory usage and the difference for some > +workloads can be substantial. [...] I like this. I also for adding a sentence about overlap in the counters: +varies by architecture and compile options. Some of the counters reported +here overlap. The memory reported by the non overlapping counters may not +add up to the overall memory usage and the difference for some workloads can be substantial. [...] > But I'd like to be a bit more explicit about the reason, hence my question > above to be sure I understand. > > It's also not entirely clear which of the fields in meminfo can be > usefully summed. VmallocTotal is larger than MemTotal, for example. > But I know that KernelStack is allocated through vmalloc these days, > and I don't know whether VmallocUsed includes KernelStack or whether I > can sum them. Similarly, is Mlocked a subset of Unevictable? > > There is some attempt at explaining how these numbers fit together, but > it's outdated, and doesn't include Mlocked, Unevictable or KernelStack Fixing the outdated docs and adding more detailed explanation is obviously welcome, but it's beyond the scope of the current patch. -- Sincerely yours, Mike.