From: Jiang Liu <liuj97@gmail.com>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
sworddragon2@aol.com, bugzilla-daemon@bugzilla.kernel.org,
linux-mm@kvack.org
Subject: Re: [Bug 53501] New: Duplicated MemTotal with different values
Date: Thu, 14 Feb 2013 12:01:49 +0800 [thread overview]
Message-ID: <511C61AD.2010702@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1302131915170.8584@chino.kir.corp.google.com>
On 02/14/2013 11:19 AM, David Rientjes wrote:
> On Tue, 12 Feb 2013, Andrew Morton wrote:
>
>>>>> The installed memory on my system is 16 GiB. /proc/meminfo is showing me
>>>>> "MemTotal: 16435048 kB" but /sys/devices/system/node/node0/meminfo is
>>>>> showing me "Node 0 MemTotal: 16776380 kB".
>>>>>
>>>>> My suggestion: MemTotal in /proc/meminfo should be 16776380 kB too. The old
>>>>> value of 16435048 kB could have its own key "MemAvailable".
>>>>
>>>> hm, mine does that too. A discrepancy between `totalram_pages' and
>>>> NODE_DATA(0)->node_present_pages.
>>>>
>>>> I don't know what the reasons are for that but yes, one would expect
>>>> the per-node MemTotals to sum up to the global one.
>>>>
>>>
>>> I'd suspect it has something to do with 9feedc9d831e ("mm: introduce new
>>> field "managed_pages" to struct zone") and 3.8 would be the first kernel
>>> release with this change. Is it possible to try 3.7 or, better yet, with
>>> this patch reverted?
>>
>> My desktop machine at google in inconsistent, as is the 2.6.32-based
>> machine, so it obviously predates 9feedc9d831e.
>>
>
> Hmm, ok. The question is which one is right: the per-node MemTotal is the
> amount of present RAM, the spanned range minus holes, and the system
> MemTotal is the amount of pages released to the buddy allocator by
> bootmem and discounts not only the memory holes but also reserved pages.
> Should they both be the amount of RAM present or the amount of unreserved
> RAM present?
>
Hi David,
We have worked out a patch set to address this issue. The first two
patches have been merged into v3.8, and another two patches are queued in
Andrew's mm tree for v3.9.
The patch set introduces a new field named managed_pages into struct
zone to distinguish between pages present in a zone and pages managed by the
buddy system. So
zone->present_pages = zone->spanned_pages - pages_in_hole;
zone->managed_pages = pages_managed_by_buddy_system_in_the_zone;
We have also added a field named "managed" into /proc/zoneinfo, but
haven't touch /proc/meminfo and /sys/devices/system/node/nodex/meminfo yet.
If preferred, we could work out another patch to enhance these two files
as suggested above.
Regards!
Gerry
--
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>
next prev parent reply other threads:[~2013-02-14 4:02 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bug-53501-27@https.bugzilla.kernel.org/>
2013-02-13 0:51 ` [Bug 53501] New: Duplicated MemTotal with different values Andrew Morton
2013-02-13 1:45 ` David Rientjes
2013-02-13 3:59 ` Andrew Morton
2013-02-14 3:19 ` David Rientjes
2013-02-14 4:01 ` Jiang Liu [this message]
2013-02-15 0:26 ` David Rientjes
2013-02-20 5:21 ` Simon Jeons
2013-02-20 7:09 ` David Rientjes
2013-03-02 2:21 ` Simon Jeons
2013-03-04 11:18 ` David Rientjes
2013-03-04 23:39 ` Simon Jeons
2013-03-05 21:53 ` David Rientjes
2013-02-16 16:27 ` [PATCH 1/2] vm: add 'MemManaged' field to /proc/meminfo and /sys/.../nodex/meminfo Jiang Liu
2013-02-19 21:29 ` David Rientjes
2013-02-20 17:27 ` [PATCH v2] mm: let /proc/meminfo report physical memory installed as "MemTotal" Jiang Liu
2013-02-20 22:49 ` Andrew Morton
2013-02-21 17:26 ` Jiang Liu
2013-02-21 21:31 ` Andrew Morton
2013-02-22 19:22 ` Jiang Liu
2013-02-16 16:27 ` [PATCH 2/2] mm: protect si_meminfo() and si_meminfo_node() from memory hotplug operations Jiang Liu
2013-02-19 21:32 ` David Rientjes
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=511C61AD.2010702@gmail.com \
--to=liuj97@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=bugzilla-daemon@bugzilla.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=sworddragon2@aol.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).