From: Dhaval Giani <dhaval@linux.vnet.ibm.com>
To: akpm@linux-foundation.org
Cc: mm-commits@vger.kernel.org, lizf@cn.fujitsu.com,
balbir@linux.vnet.ibm.com, kamezawa.hiroyu@jp.fujitsu.com,
menage@google.com, lkml <linux-kernel@vger.kernel.org>,
Bharata B Rao <bharata@linux.vnet.ibm.com>,
libcg-devel <libcg-devel@lists.sourceforge.net>
Subject: Re: + cgroups-forbid-noprefix-if-mounting-more-than-just-cpuset-subsystem. patch added to -mm tree
Date: Tue, 2 Jun 2009 14:39:44 +0530 [thread overview]
Message-ID: <20090602090944.GB16753@linux.vnet.ibm.com> (raw)
In-Reply-To: <200906020602.n5262wcu008560@imap1.linux-foundation.org>
On Mon, Jun 01, 2009 at 11:02:58PM -0700, akpm@linux-foundation.org wrote:
>
> The patch titled
> cgroups: forbid noprefix if mounting more than just cpuset subsystem
> has been added to the -mm tree. Its filename is
> cgroups-forbid-noprefix-if-mounting-more-than-just-cpuset-subsystem.patch
>
> Before you just go and hit "reply", please:
> a) Consider who else should be cc'ed
> b) Prefer to cc a suitable mailing list as well
> c) Ideally: find the original patch on the mailing list and do a
> reply-to-all to that, adding suitable additional cc's
>
> *** Remember to use Documentation/SubmitChecklist when testing your code ***
>
> See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
> out what to do about this
>
> The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
>
> ------------------------------------------------------
> Subject: cgroups: forbid noprefix if mounting more than just cpuset subsystem
> From: Li Zefan <lizf@cn.fujitsu.com>
>
> The 'noprefix' option was introduced for backwards-compatibility of
> cpuset, but actually it can be used when mounting other subsystems.
>
> This results in possibility of name collision, and now the collision can
> really happen, because we have 'stat' file in both memory and cpuacct
> subsystem:
>
> # mount -t cgroup -o noprefix,memory,cpuacct xxx /mnt
>
> Cgroup will happily mount the 2 subsystems, but only 'stat' file of memory
> subsys can be seen.
>
> We don't want users to use nopreifx, and also want to avoid name
> collision, so we change to allow noprefix only if mounting just the cpuset
> subsystem.
>
I am not sure if this is a good idea. For libcgroup, we would then be
adding a special case for just cpuset. I would rather that we allow it
either for all the subsystems or none of them.
thanks,
> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
> Cc: Paul Menage <menage@google.com>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
> Cc: Dhaval Giani <dhaval@linux.vnet.ibm.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> kernel/cgroup.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff -puN kernel/cgroup.c~cgroups-forbid-noprefix-if-mounting-more-than-just-cpuset-subsystem kernel/cgroup.c
> --- a/kernel/cgroup.c~cgroups-forbid-noprefix-if-mounting-more-than-just-cpuset-subsystem
> +++ a/kernel/cgroup.c
> @@ -842,6 +842,11 @@ static int parse_cgroupfs_options(char *
> struct cgroup_sb_opts *opts)
> {
> char *token, *o = data ?: "all";
> + unsigned long mask = (unsigned long)-1;
> +
> +#ifdef CONFIG_CPUSETS
> + mask = ~(1 << cpuset_subsys_id);
> +#endif
>
> opts->subsys_bits = 0;
> opts->flags = 0;
> @@ -886,6 +891,11 @@ static int parse_cgroupfs_options(char *
> }
> }
>
> + /* We allow noprefix only if mounting just the cpuset subsystem */
> + if (test_bit(ROOT_NOPREFIX, &opts->flags) &&
> + (opts->subsys_bits & mask))
> + return -EINVAL;
> +
> /* We can't have an empty hierarchy */
> if (!opts->subsys_bits)
> return -EINVAL;
> _
>
> Patches currently in -mm which might be from lizf@cn.fujitsu.com are
>
> origin.patch
> linux-next.patch
> mm-add-swap-cache-interface-for-swap-reference.patch
> mm-modify-swap_map-and-add-swap_has_cache-flag.patch
> mm-reuse-unused-swap-entry-if-necessary.patch
> hexdump-remove-the-trailing-space.patch
> cgroups-make-messages-more-readable.patch
> cgroups-forbid-noprefix-if-mounting-more-than-just-cpuset-subsystem.patch
> devcgroup-skip-superfluous-checks-when-found-the-dev_all-elem.patch
> memcg-remove-some-redundant-checks.patch
> memcg-remove-unneeded-forward-declaration-from-schedh.patch
> memcg-fix-swap-accounting.patch
--
regards,
Dhaval
next parent reply other threads:[~2009-06-02 9:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200906020602.n5262wcu008560@imap1.linux-foundation.org>
2009-06-02 9:09 ` Dhaval Giani [this message]
2009-06-02 16:08 ` + cgroups-forbid-noprefix-if-mounting-more-than-just-cpuset-subsystem. patch added to -mm tree Paul Menage
2009-06-02 17:40 ` Dhaval Giani
2009-06-02 20:35 ` Andrew Morton
2009-06-03 0:02 ` KAMEZAWA Hiroyuki
2009-06-03 5:20 ` Dhaval Giani
2009-06-02 23:27 ` Balbir Singh
2009-06-03 0:53 ` Li Zefan
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=20090602090944.GB16753@linux.vnet.ibm.com \
--to=dhaval@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=bharata@linux.vnet.ibm.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=libcg-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=menage@google.com \
--cc=mm-commits@vger.kernel.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