From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Glauber Costa <glommer@parallels.com>
Cc: linux-kernel@vger.kernel.org, paul@paulmenage.org,
lizf@cn.fujitsu.com, ebiederm@xmission.com, davem@davemloft.net,
gthelen@google.com, netdev@vger.kernel.org, linux-mm@kvack.org,
kirill@shutemov.name, avagin@parallels.com
Subject: Re: [PATCH v4 1/8] Basic kernel memory functionality for the Memory Controller
Date: Tue, 4 Oct 2011 09:38:51 +0900 [thread overview]
Message-ID: <20111004093851.7536e505.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <1317637123-18306-2-git-send-email-glommer@parallels.com>
On Mon, 3 Oct 2011 14:18:36 +0400
Glauber Costa <glommer@parallels.com> wrote:
> This patch lays down the foundation for the kernel memory component
> of the Memory Controller.
>
> As of today, I am only laying down the following files:
>
> * memory.independent_kmem_limit
> * memory.kmem.limit_in_bytes (currently ignored)
> * memory.kmem.usage_in_bytes (always zero)
>
> Signed-off-by: Glauber Costa <glommer@parallels.com>
> CC: Paul Menage <paul@paulmenage.org>
> CC: Greg Thelen <gthelen@google.com>
> ---
> Documentation/cgroups/memory.txt | 30 +++++++++++-
> init/Kconfig | 11 ++++
> mm/memcontrol.c | 94 +++++++++++++++++++++++++++++++++++---
> 3 files changed, 126 insertions(+), 9 deletions(-)
>
> diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
> index 6f3c598..6f1954a 100644
> --- a/Documentation/cgroups/memory.txt
> +++ b/Documentation/cgroups/memory.txt
> @@ -44,8 +44,9 @@ Features:
> - oom-killer disable knob and oom-notifier
> - Root cgroup has no limit controls.
>
> - Kernel memory and Hugepages are not under control yet. We just manage
> - pages on LRU. To add more controls, we have to take care of performance.
> + Hugepages is not under control yet. We just manage pages on LRU. To add more
> + controls, we have to take care of performance. Kernel memory support is work
> + in progress, and the current version provides basically functionality.
>
> Brief summary of control files.
>
> @@ -56,8 +57,11 @@ Brief summary of control files.
> (See 5.5 for details)
> memory.memsw.usage_in_bytes # show current res_counter usage for memory+Swap
> (See 5.5 for details)
> + memory.kmem.usage_in_bytes # show current res_counter usage for kmem only.
> + (See 2.7 for details)
> memory.limit_in_bytes # set/show limit of memory usage
> memory.memsw.limit_in_bytes # set/show limit of memory+Swap usage
> + memory.kmem.limit_in_bytes # if allowed, set/show limit of kernel memory
> memory.failcnt # show the number of memory usage hits limits
> memory.memsw.failcnt # show the number of memory+Swap hits limits
> memory.max_usage_in_bytes # show max memory usage recorded
> @@ -72,6 +76,9 @@ Brief summary of control files.
> memory.oom_control # set/show oom controls.
> memory.numa_stat # show the number of memory usage per numa node
>
> + memory.independent_kmem_limit # select whether or not kernel memory limits are
> + independent of user limits
> +
> 1. History
>
> The memory controller has a long history. A request for comments for the memory
> @@ -255,6 +262,25 @@ When oom event notifier is registered, event will be delivered.
> per-zone-per-cgroup LRU (cgroup's private LRU) is just guarded by
> zone->lru_lock, it has no lock of its own.
>
> +2.7 Kernel Memory Extension (CONFIG_CGROUP_MEM_RES_CTLR_KMEM)
> +
> + With the Kernel memory extension, the Memory Controller is able to limit
> +the amount of kernel memory used by the system. Kernel memory is fundamentally
> +different than user memory, since it can't be swapped out, which makes it
> +possible to DoS the system by consuming too much of this precious resource.
> +Kernel memory limits are not imposed for the root cgroup.
> +
> +Memory limits as specified by the standard Memory Controller may or may not
> +take kernel memory into consideration. This is achieved through the file
> +memory.independent_kmem_limit. A Value different than 0 will allow for kernel
> +memory to be controlled separately.
> +
> +When kernel memory limits are not independent, the limit values set in
> +memory.kmem files are ignored.
> +
> +Currently no soft limit is implemented for kernel memory. It is future work
> +to trigger slab reclaim when those limits are reached.
> +
Please add some CAUTION like
==
"CAUTION: the kmem extetion prevents tasks from moving among cgroups.
If a task has kmem accounting in a cgroup, the task cannot be moved
until the kmem resource is released. And more, until the resource is
fully released, the cgroup cannot be destroyed. So, please consider
your use cases and set kmem extention config carefully".
==
And add some memo to KCONFIG. This should be warned.
> +config CGROUP_MEM_RES_CTLR_KMEM
> + bool "Memory Resource Controller Kernel Memory accounting (EXPERIMENTAL)"
> + depends on CGROUP_MEM_RES_CTLR && EXPERIMENTAL
> + default y
default must be n until you fixes the bug.
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>
next prev parent reply other threads:[~2011-10-04 0:40 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-03 10:18 [PATCH v4 0/8] per-cgroup tcp buffer pressure settings Glauber Costa
2011-10-03 10:18 ` [PATCH v4 1/8] Basic kernel memory functionality for the Memory Controller Glauber Costa
2011-10-03 10:41 ` Kirill A. Shutemov
2011-10-03 10:41 ` Glauber Costa
2011-10-04 0:38 ` KAMEZAWA Hiroyuki [this message]
2011-10-03 10:18 ` [PATCH v4 2/8] socket: initial cgroup code Glauber Costa
2011-10-03 10:47 ` Kirill A. Shutemov
2011-10-03 10:48 ` Glauber Costa
2011-10-03 11:02 ` Kirill A. Shutemov
2011-10-03 11:03 ` Glauber Costa
2011-10-04 0:41 ` KAMEZAWA Hiroyuki
2011-10-03 10:18 ` [PATCH v4 3/8] foundations of per-cgroup memory pressure controlling Glauber Costa
2011-10-03 15:13 ` Andrew Vagin
2011-10-04 0:57 ` KAMEZAWA Hiroyuki
2011-10-04 6:32 ` Glauber Costa
2011-10-04 7:13 ` Glauber Costa
2011-10-03 10:18 ` [PATCH v4 4/8] per-cgroup tcp buffers control Glauber Costa
2011-10-04 1:16 ` KAMEZAWA Hiroyuki
2011-10-04 5:43 ` Glauber Costa
2011-10-03 10:18 ` [PATCH v4 5/8] per-netns ipv4 sysctl_tcp_mem Glauber Costa
2011-10-04 1:18 ` KAMEZAWA Hiroyuki
2011-10-03 10:18 ` [PATCH v4 6/8] tcp buffer limitation: per-cgroup limit Glauber Costa
2011-10-04 1:21 ` KAMEZAWA Hiroyuki
2011-10-04 6:22 ` Glauber Costa
2011-10-03 10:18 ` [PATCH v4 7/8] Display current tcp memory allocation in kmem cgroup Glauber Costa
2011-10-03 12:14 ` Kirill A. Shutemov
2011-10-03 12:19 ` Glauber Costa
2011-10-03 12:25 ` Kirill A. Shutemov
2011-10-03 12:26 ` Glauber Costa
2011-10-03 12:36 ` Kirill A. Shutemov
2011-10-03 12:36 ` Glauber Costa
2011-10-04 9:10 ` Glauber Costa
2011-10-06 8:46 ` Kirill A. Shutemov
2011-10-03 10:18 ` [PATCH v4 8/8] Disable task moving when using kernel memory accounting Glauber Costa
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=20111004093851.7536e505.kamezawa.hiroyu@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=avagin@parallels.com \
--cc=davem@davemloft.net \
--cc=ebiederm@xmission.com \
--cc=glommer@parallels.com \
--cc=gthelen@google.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lizf@cn.fujitsu.com \
--cc=netdev@vger.kernel.org \
--cc=paul@paulmenage.org \
/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