linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Cc: David Rientjes <rientjes@google.com>,
	Gao feng <gaofeng@cn.fujitsu.com>,
	hannes@cmpxchg.org, mhocko@suse.cz, bsingharora@gmail.com,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	cgroups@vger.kernel.org, linux-mm@kvack.org,
	containers@lists.linux-foundation.org
Subject: Re: [PATCH] meminfo: show /proc/meminfo base on container's memcg
Date: Thu, 31 May 2012 09:33:02 +0900	[thread overview]
Message-ID: <4FC6BC3E.5010807@jp.fujitsu.com> (raw)
In-Reply-To: <CAHGf_=pFbsy4FO_UNu6O1-KyTd6O=pkmR8=3EGuZB5Reu3Vb9w@mail.gmail.com>

(2012/05/31 9:22), KOSAKI Motohiro wrote:
> On Wed, May 30, 2012 at 8:08 PM, Kamezawa Hiroyuki
> <kamezawa.hiroyu@jp.fujitsu.com>  wrote:
>> (2012/05/31 6:38), David Rientjes wrote:
>>>
>>> On Tue, 29 May 2012, Gao feng wrote:
>>>
>>>> cgroup and namespaces are used for creating containers but some of
>>>> information is not isolated/virtualized. This patch is for isolating
>>>> /proc/meminfo
>>>> information per container, which uses memory cgroup. By this, top,free
>>>> and other tools under container can work as expected(show container's
>>>> usage) without changes.
>>>>
>>>> This patch is a trial to show memcg's info in /proc/meminfo if 'current'
>>>> is under a memcg other than root.
>>>>
>>>> we show /proc/meminfo base on container's memory cgroup.
>>>> because there are lots of info can't be provide by memcg, and
>>>> the cmds such as top, free just use some entries of /proc/meminfo,
>>>> we replace those entries by memory cgroup.
>>>>
>>>> if container has no memcg, we will show host's /proc/meminfo
>>>> as before.
>>>>
>>>> there is no idea how to deal with Buffers,I just set it zero,
>>>> It's strange if Buffers bigger than MemTotal.
>>>>
>>>> Signed-off-by: Gao feng<gaofeng@cn.fujitsu.com>
>>>
>>>
>>> Nack, this type of thing was initially tried with cpusets when a thread
>>> was bound to a subset of nodes, i.e. only show the total amount of memory
>>> spanned by those nodes.
>>>
>>
>> Hmm. How about having memory.meminfo under memory cgroup directory and
>> use it with bind mount ? (container tools will be able to help it.)
>> Then, container applications(top,free,etc..) can read the values they wants.
>> If admins don't want it, they'll not use bind mount.
>
> +1. 50% users need namespace separation and others don't. We need a
> selectability.

My test with sysfs node's meminfo seems to work...

[root@rx100-1 qqm]# mount --bind /sys/devices/system/node/node0/meminfo /proc/meminfo
[root@rx100-1 qqm]# cat /proc/meminfo

Node 0 MemTotal:        8379636 kB
Node 0 MemFree:         4050224 kB
Node 0 MemUsed:         4329412 kB
Node 0 Active:          3010876 kB
Node 0 Inactive:         507480 kB
Node 0 Active(anon):    2671920 kB
Node 0 Inactive(anon):   111596 kB
Node 0 Active(file):     338956 kB
Node 0 Inactive(file):   395884 kB
Node 0 Unevictable:       48316 kB
Node 0 Mlocked:           11524 kB
Node 0 Dirty:                 8 kB
Node 0 Writeback:             0 kB
Node 0 FilePages:        744908 kB
Node 0 Mapped:            20604 kB
Node 0 AnonPages:       1344940 kB
Node 0 Shmem:              1448 kB
Node 0 KernelStack:        3528 kB
Node 0 PageTables:        53840 kB
Node 0 NFS_Unstable:          0 kB
Node 0 Bounce:                0 kB
Node 0 WritebackTmp:          0 kB
Node 0 Slab:             184404 kB
Node 0 SReclaimable:     131060 kB
Node 0 SUnreclaim:        53344 kB
Node 0 HugePages_Total:     0
Node 0 HugePages_Free:      0
Node 0 HugePages_Surp:      0

Thanks,
-Kame

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2012-05-31  0:35 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-29  2:56 Gao feng
2012-05-29  8:24 ` Glauber Costa
2012-05-30 21:38 ` David Rientjes
2012-05-30 23:20   ` Kirill A. Shutemov
2012-05-31  0:35     ` David Rientjes
2012-05-31  0:08   ` Kamezawa Hiroyuki
2012-05-31  0:22     ` KOSAKI Motohiro
2012-05-31  0:33       ` Kamezawa Hiroyuki [this message]
2012-05-31  0:44         ` David Rientjes
2012-05-31  0:53           ` Kamezawa Hiroyuki
2012-05-31  1:31             ` David Rientjes
2012-05-31  2:33               ` Kamezawa Hiroyuki
2012-05-31  5:02                 ` David Rientjes
2012-05-31  5:36                   ` Kamezawa Hiroyuki
2012-05-31  6:17                     ` David Rientjes
2012-05-31  6:23                       ` KOSAKI Motohiro
2012-05-31  6:28                         ` David Rientjes
2012-05-31  6:37                           ` KOSAKI Motohiro
2012-05-31  6:56                             ` David Rientjes
2012-05-31  7:09                               ` KOSAKI Motohiro
2012-05-31  7:35                                 ` David Rientjes
2012-05-31  7:42                                   ` KOSAKI Motohiro
2012-05-31  7:57                                     ` Johannes Weiner
2012-05-31  7:58                                     ` Gao feng
2012-05-31  8:32                                       ` Glauber Costa
2012-05-31  8:51                                         ` Kamezawa Hiroyuki
2012-05-31  8:59                                           ` Glauber Costa
2012-05-31  8:55                                         ` Gao feng
2012-05-31  8:56                                           ` Glauber Costa
2012-05-31  7:07                             ` Kamezawa Hiroyuki
2012-05-31  7:23                               ` KOSAKI Motohiro
2012-05-31  8:29                       ` Glauber Costa
2012-06-07 23:18 ` Zhu Yanhai

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=4FC6BC3E.5010807@jp.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=bsingharora@gmail.com \
    --cc=cgroups@vger.kernel.org \
    --cc=containers@lists.linux-foundation.org \
    --cc=gaofeng@cn.fujitsu.com \
    --cc=hannes@cmpxchg.org \
    --cc=kosaki.motohiro@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=rientjes@google.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