From: Li Zefan <lizf@cn.fujitsu.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Paul Menage <menage@google.com>,
Balbir Singh <balbir@linux.vnet.ibm.com>,
LKML <linux-kernel@vger.kernel.org>,
Linux Containers <containers@lists.osdl.org>
Subject: [PATCH -mm] cgroup: fix boot option parsing
Date: Mon, 17 Mar 2008 17:24:57 +0900 [thread overview]
Message-ID: <47DE2AD9.503@cn.fujitsu.com> (raw)
When boot with 'cgroup_disable=cpuacct', it turns out subsystem
'cpu' is disabled.
When Balbir posted the patch to add cgroup boot option support,
Paul M noticed this problem, but the patch was accepted without
fixing it.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
kernel/cgroup.c | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index e8e8ec4..54c28ea 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -3062,25 +3062,22 @@ static void cgroup_release_agent(struct work_struct *work)
static int __init cgroup_disable(char *str)
{
int i;
+ char *token;
+
+ while ((token = strsep(&str, ",")) != NULL) {
+ if (!*token)
+ continue;
- while (*str) {
for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
struct cgroup_subsys *ss = subsys[i];
- if (!strncmp(str, ss->name, strlen(ss->name))) {
+ if (!strcmp(token, ss->name)) {
ss->disabled = 1;
printk(KERN_INFO "Disabling %s control group"
" subsystem\n", ss->name);
break;
}
}
- /*
- * Find the next option if any
- */
- while (*str && (*str != ','))
- str++;
- if (*str == ',')
- str++;
}
return 1;
}
--
1.5.4.rc3
next reply other threads:[~2008-03-17 8:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-17 8:24 Li Zefan [this message]
2008-03-17 8:26 ` [PATCH -mm] cgroup: fix boot option parsing 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=47DE2AD9.503@cn.fujitsu.com \
--to=lizf@cn.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=containers@lists.osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=menage@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