All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Gushchin <guro@fb.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: <linux-mm@kvack.org>, Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	Andrea Arcangeli <aarcange@redhat.com>, <kernel-team@fb.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: show stats for non-default hugepage sizes in /proc/meminfo
Date: Mon, 13 Nov 2017 16:33:05 +0000	[thread overview]
Message-ID: <20171113163233.GA17016@castle> (raw)
In-Reply-To: <20171113161102.rieyg55drdqkri6e@dhcp22.suse.cz>

On Mon, Nov 13, 2017 at 05:11:02PM +0100, Michal Hocko wrote:
> On Mon 13-11-17 16:03:02, Roman Gushchin wrote:
> > Currently we display some hugepage statistics (total, free, etc)
> > in /proc/meminfo, but only for default hugepage size (e.g. 2Mb).
> > 
> > If hugepages of different sizes are used (like 2Mb and 1Gb on x86-64),
> > /proc/meminfo output can be confusing, as non-default sized hugepages
> > are not reflected at all, and there are no signs that they are
> > existing and consuming system memory.
> 
> Yes this sucks but we do have per numa node per h-state stats in sysfs
> already /sys/devices/system/node/node*/hugepages
> 
> I know it is another source of the information but is there any reason
> you cannot use it?

Hi, Michal!

In my case, I didn't know in advance, that hugetlb pages are preallocated,
and spent some time trying to find "magically disappeared" several Gb of memory,
which are not reflected in any /proc/[meminfo,vmstat] counters.

IMO, /proc/meminfo should give a user a high-level overview of memory usage
in the system, without a need to look into other places. Of course, we always
have some amount of unaccounted memory, but it shouldn't be measured in Gb,
as in this case.

If you're worried about adding counters which will be 0 most of the time
for most users, we can print them conditionally, only if total number of
corresponding pages is not 0.

Thanks!

WARNING: multiple messages have this Message-ID (diff)
From: Roman Gushchin <guro@fb.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	kernel-team@fb.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: show stats for non-default hugepage sizes in /proc/meminfo
Date: Mon, 13 Nov 2017 16:33:05 +0000	[thread overview]
Message-ID: <20171113163233.GA17016@castle> (raw)
In-Reply-To: <20171113161102.rieyg55drdqkri6e@dhcp22.suse.cz>

On Mon, Nov 13, 2017 at 05:11:02PM +0100, Michal Hocko wrote:
> On Mon 13-11-17 16:03:02, Roman Gushchin wrote:
> > Currently we display some hugepage statistics (total, free, etc)
> > in /proc/meminfo, but only for default hugepage size (e.g. 2Mb).
> > 
> > If hugepages of different sizes are used (like 2Mb and 1Gb on x86-64),
> > /proc/meminfo output can be confusing, as non-default sized hugepages
> > are not reflected at all, and there are no signs that they are
> > existing and consuming system memory.
> 
> Yes this sucks but we do have per numa node per h-state stats in sysfs
> already /sys/devices/system/node/node*/hugepages
> 
> I know it is another source of the information but is there any reason
> you cannot use it?

Hi, Michal!

In my case, I didn't know in advance, that hugetlb pages are preallocated,
and spent some time trying to find "magically disappeared" several Gb of memory,
which are not reflected in any /proc/[meminfo,vmstat] counters.

IMO, /proc/meminfo should give a user a high-level overview of memory usage
in the system, without a need to look into other places. Of course, we always
have some amount of unaccounted memory, but it shouldn't be measured in Gb,
as in this case.

If you're worried about adding counters which will be 0 most of the time
for most users, we can print them conditionally, only if total number of
corresponding pages is not 0.

Thanks!

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-11-13 16:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-13 16:03 [PATCH] mm: show stats for non-default hugepage sizes in /proc/meminfo Roman Gushchin
2017-11-13 16:03 ` Roman Gushchin
2017-11-13 16:11 ` Michal Hocko
2017-11-13 16:11   ` Michal Hocko
2017-11-13 16:33   ` Roman Gushchin [this message]
2017-11-13 16:33     ` Roman Gushchin
2017-11-14  8:21     ` Michal Hocko
2017-11-14  8:21       ` Michal Hocko
2017-11-13 17:06 ` Dave Hansen
2017-11-13 17:06   ` Dave Hansen
2017-11-13 18:11   ` Roman Gushchin
2017-11-13 18:11     ` Roman Gushchin
2017-11-13 18:17     ` Dave Hansen
2017-11-13 18:17       ` Dave Hansen
2017-11-13 18:30       ` Mike Kravetz
2017-11-13 18:30         ` Mike Kravetz
2017-11-13 18:45         ` Roman Gushchin
2017-11-13 18:45           ` Roman Gushchin
2017-11-13 19:10           ` Johannes Weiner
2017-11-13 19:10             ` Johannes Weiner
2017-11-13 19:25             ` Mike Kravetz
2017-11-13 19:25               ` Mike Kravetz
2017-11-14 12:48               ` Roman Gushchin
2017-11-14 12:48                 ` Roman Gushchin
2017-11-13 19:31             ` Dave Hansen
2017-11-13 19:31               ` Dave Hansen

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=20171113163233.GA17016@castle \
    --to=guro@fb.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=mike.kravetz@oracle.com \
    /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.