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@xxxxxxxxxxxxxx>
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.