From: "Paul Menage" <menage@google.com>
To: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Containers <containers@lists.osdl.org>,
YAMAMOTO Takashi <yamamoto@valinux.co.jp>,
Linux MM Mailing List <linux-mm@kvack.org>,
Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>,
Pavel Emelianov <xemul@openvz.org>,
Dave Hansen <haveblue@us.ibm.com>,
Eric W Biederman <ebiederm@xmission.com>
Subject: Re: [RFC][-mm PATCH 2/8] Memory controller containers setup (v3)
Date: Fri, 20 Jul 2007 13:30:26 -0700 [thread overview]
Message-ID: <6599ad830707201330t419458f2tba2d7a31d3b9701e@mail.gmail.com> (raw)
In-Reply-To: <20070720082416.20752.92946.sendpatchset@balbir-laptop>
On 7/20/07, Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
>
> +config CONTAINER_MEM_CONT
> + bool "Memory controller for containers"
> + select CONTAINERS
Andrew asked me to not use "select" in Kconfig files due to some
unspecified problems seen in the past, so my latest patchset makes the
subsystems depend on containers rather than selecting them; I prefer
the select approach over the dependency approach, but if select does
have problems then we should be consistent.
> +static struct cftype mem_container_usage = {
> + .name = "mem_usage",
> + .private = RES_USAGE,
For V11, the .name field should just be called something like 'usage';
the subsystem name is automatically prefixed.
> +
> +static int mem_container_create(struct container_subsys *ss,
> + struct container *cont)
> +{
> + struct mem_container *mem;
> +
> + mem = kzalloc(sizeof(struct mem_container), GFP_KERNEL);
> + if (!mem)
> + return -ENOMEM;
> +
> + res_counter_init(&mem->res);
> + cont->subsys[mem_container_subsys_id] = &mem->css;
> + mem->css.container = cont;
> + return 0;
For the V11 patchset, you'll want to replace these three lines with just
return &mem->css;
> +static int mem_container_populate(struct container_subsys *ss,
> + struct container *cont)
> +{
> + int rc = 0;
> +
> + rc = container_add_file(cont, &mem_container_usage);
> + if (rc < 0)
> + goto err;
> +
> + rc = container_add_file(cont, &mem_container_limit);
> + if (rc < 0)
> + goto err;
> +
> + rc = container_add_file(cont, &mem_container_failcnt);
> + if (rc < 0)
> + goto err;
There's a container_add_files() API in V10 and above that lets you
register an array of files in one go.
> +
> +err:
> + return rc;
> +}
> +
> +struct container_subsys mem_container_subsys = {
> + .name = "mem_container",
Maybe just "memory" or "pages" for the container name?
Paul
--
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:[~2007-07-20 20:30 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-20 8:23 [RFC][-mm PATCH 0/8] Memory controller introduction (v3) Balbir Singh
2007-07-20 8:24 ` [RFC][-mm PATCH 1/8] Memory controller resource counters (v3) Balbir Singh
2007-07-20 20:20 ` Paul Menage
2007-07-21 17:00 ` Balbir Singh
2007-07-20 8:24 ` [RFC][-mm PATCH 2/8] Memory controller containers setup (v3) Balbir Singh
2007-07-20 20:30 ` Paul Menage [this message]
2007-07-21 17:04 ` Balbir Singh
2007-07-20 8:24 ` [RFC][-mm PATCH 3/8] Memory controller accounting " Balbir Singh
2007-07-20 20:33 ` Paul Menage
2007-07-20 20:39 ` Paul Menage
2007-07-20 8:24 ` [RFC][-mm PATCH 4/8] Memory controller memory accounting (v3) Balbir Singh
2007-07-20 21:03 ` Paul Menage
2007-07-20 21:09 ` Paul Menage
2007-07-21 17:11 ` Balbir Singh
2007-07-20 8:24 ` [RFC][-mm PATCH 5/8] Memory controller task migration (v3) Balbir Singh
2007-07-20 8:25 ` [RFC][-mm PATCH 6/8] Memory controller add per container LRU and reclaim (v3) Balbir Singh
2007-07-24 11:51 ` YAMAMOTO Takashi
2007-07-24 12:14 ` Balbir Singh
2007-07-20 8:25 ` [RFC][-mm PATCH 7/8] Memory controller OOM handling (v3) Balbir Singh
2007-07-20 8:25 ` [RFC][-mm PATCH 8/8] Add switch to control what type of pages to limit (v3) Balbir Singh
2007-07-20 21:41 ` Paul Menage
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=6599ad830707201330t419458f2tba2d7a31d3b9701e@mail.gmail.com \
--to=menage@google.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=containers@lists.osdl.org \
--cc=ebiederm@xmission.com \
--cc=haveblue@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=svaidy@linux.vnet.ibm.com \
--cc=xemul@openvz.org \
--cc=yamamoto@valinux.co.jp \
/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