From: Mike Rapoport <rppt@kernel.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: Jonathan Corbet <corbet@lwn.net>,
Alexey Dobriyan <adobriyan@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Eric Dumazet <eric.dumazet@gmail.com>,
Michal Hocko <mhocko@suse.com>,
Mike Rapoport <rppt@linux.ibm.com>,
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
Date: Tue, 20 Apr 2021 17:51:51 +0300 [thread overview]
Message-ID: <YH7qhwhbLt0yT3Zy@kernel.org> (raw)
In-Reply-To: <20210420132430.GB3596236@casper.infradead.org>
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.
prev parent reply other threads:[~2021-04-20 14:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-20 12:13 [PATCH v2] docs: proc.rst: meminfo: briefly describe gaps in memory accounting Mike Rapoport
2021-04-20 12:21 ` Mike Rapoport
2021-04-20 13:12 ` Michal Hocko
2021-04-20 13:24 ` Matthew Wilcox
2021-04-20 13:57 ` Michal Hocko
2021-04-20 14:05 ` Michal Hocko
2021-04-20 17:58 ` Alexey Dobriyan
2021-04-21 6:35 ` Michal Hocko
2021-04-20 14:51 ` Mike Rapoport [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YH7qhwhbLt0yT3Zy@kernel.org \
--to=rppt@kernel.org \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=eric.dumazet@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=netdev@vger.kernel.org \
--cc=rppt@linux.ibm.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.