Re: [PATCH] meminfo: show /proc/meminfo base on container's memcg

From: David Rientjes
Date: Wed May 30 2012 - 20:35:53 EST


On Thu, 31 May 2012, Kirill A. Shutemov wrote:

> > Why? Because the information exported by /proc/meminfo is considered by
> > applications to be static whereas the limit of a memcg may change without
> > any knowledge of the application.
>
> Memory hotplug does the same, right?
>

Memory hotplug is a seperate topic, it changes the amount of physical
memory that is available to the kernel, not any limitation of memory
available to a set of tasks. For memory hot-add, this does not
automatically increase the memory.limit_in_bytes of any non-root memcg,
the memory usage is still constrained as it was before the hotplug event.
Thus, applications would want to depend on memory.{limit,usage}_in_bytes
specifically to determine the amount of available memory even with
CONFIG_MEMORY_HOTPLUG.

Also, under certain cirucmstances such as when a thread is oom killed, it
may allocate memory in excess of its memcg limitation and this wouldn't be
visible as available with this patch via /proc/meminfo. Cpusets allows
softwall allocations even when a thread is simply exiting on all nodes
(and for GFP_ATOMIC allocations) and this also wouldn't be visible in
/proc/meminfo.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/