All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Paul Menage <menage@google.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	containers@lists.linux-foundation.org
Subject: Re: Question for remount
Date: Tue, 24 Feb 2009 09:33:38 +0800	[thread overview]
Message-ID: <49A34E72.1040609@cn.fujitsu.com> (raw)
In-Reply-To: <20090224085724.4cc1b3b2.kamezawa.hiroyu@jp.fujitsu.com>

KAMEZAWA Hiroyuki wrote:
> On Mon, 23 Feb 2009 10:32:46 +0800
> Li Zefan <lizf@cn.fujitsu.com> wrote:
> 
>> KAMEZAWA Hiroyuki wrote:
>>> Paul Menage さんは書きました:
>>>> On Fri, Feb 20, 2009 at 2:02 AM, KAMEZAWA Hiroyuki
>>>> <kamezawa.hiroyu@jp.fujitsu.com> wrote:
>>>>> 2. /proc/mounts information of release_agent should be updated....
>>>>>   when it's overwritten directly.
>>>> Yes, definitely. But shouldn't that happen already?
>>>> cgroup_show_options() reports the current value of
>>>> root->release_agent_path in /proc/mounts. Is it possible that mount is
>>>> actually storing/retrieving this information in /etc/mtab, which
>>>> doesn't get updated?
>>>>
>>> Ah, you're right. /proc/mounts is updated but /etc/mtab is not updated.
>>> Hmm..from man mount(1), /etc/mtab is not synchronized with /proc/mounts.
>>> Do we need to allow release_agent override at remount ?
>>>
>> Since we've allowed this behavior, I think we shouldn't disallow it to
>> supprise users?
>>
> In a bit different stroy, it already surprises a user (me).
> for example)
> 

I think what may surprise people is the following mount will append opts
to the original opts.

> #mount -t cgroup none /cgroups -ocpu,release_agent=hogehoge
> #mount -oremount,cpuacct /cgroups,release_agent=xxxx
> => remount fails. because the option "release_agent" appears twice.
> 
> #mount -t cgroup none /cgroups -ocpu,release_agent=hogehoge
> #mount -t cgroup none /cgroups -oremount,cpuacct /cgroups,release_agent=xxxx
> => remount success.
> 
> At least, updating documentation to notice this is necessary I think.
> 

How about this:

[PATCH] cgroups: more documentation for remount and release_agent

This won't remove cpuacct from the mounted hierachy:
 # mount -t cgroup -o cpu,cpuacct xxx /mnt
 # mount -o remount,cpu /mnt

Because for this usage mount(8) will append the new options to the original
options.

And this will get you right:
 # mount [-t cgroup] -o remount,cpu xxx /mnt

Also document how to specify and change release_agent.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt
index 93feb84..824277d 100644
--- a/Documentation/cgroups/cgroups.txt
+++ b/Documentation/cgroups/cgroups.txt
@@ -337,8 +337,19 @@ subsystems, type:
 
 To change the set of subsystems bound to a mounted hierarchy, just
 remount with different options:
+# mount -o remount,cpuset,ns hier1 /dev/cgroup
 
-# mount -o remount,cpuset,ns  /dev/cgroup
+Now numtasks is removed from the hierarchy and ns is added.
+
+Note this will add ns to the hierarchy but won't remove numtasks or
+cpuset:
+# mount -o remount,ns /dev/cgroup
+
+To Specify a hierarchy's release_agent:
+# mount -t cgroup -o cpuset,release_agent="/sbin/cpuset_release_agent" \
+  xxx /dev/cgroup
+
+Note that specifying 'release_agent' more than once will return failure.
 
 Note that changing the set of subsystems is currently only supported
 when the hierarchy consists of a single (root) cgroup. Supporting
@@ -349,6 +360,11 @@ Then under /dev/cgroup you can find a tree that corresponds to the
 tree of the cgroups in the system. For instance, /dev/cgroup
 is the cgroup that holds the whole system.
 
+If you want to change the value of release_agent:
+# echo "/sbin/new_release_agent" > /dev/cgroup/release_agent
+
+It can also be changed via remount.
+
 If you want to create a new cgroup under /dev/cgroup:
 # cd /dev/cgroup
 # mkdir my_cgroup


  reply	other threads:[~2009-02-24  1:33 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-20 10:02 Question for remount KAMEZAWA Hiroyuki
2009-02-20 16:22 ` Paul Menage
2009-02-21  0:45   ` KAMEZAWA Hiroyuki
     [not found]     ` <d7928a87d8c1bf661e3a3b64db9fa988.squirrel-n3SY6/QrmYVJe+uFzlzAcYO9/linGGC/AL8bYrjMMd8@public.gmane.org>
2009-02-23  2:32       ` Li Zefan
2009-02-23  2:32     ` Li Zefan
2009-02-23 23:57       ` KAMEZAWA Hiroyuki
2009-02-24  1:33         ` Li Zefan [this message]
     [not found]         ` <20090224085724.4cc1b3b2.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2009-02-24  1:33           ` Li Zefan
     [not found]       ` <49A20ACE.7020309-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2009-02-23 23:57         ` KAMEZAWA Hiroyuki
     [not found]   ` <6599ad830902200822u6d453340me718bacac3925040-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-02-21  0:45     ` KAMEZAWA Hiroyuki
     [not found] ` <20090220190223.e8b4f6a8.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2009-02-20 16:22   ` Paul Menage
2009-02-23  2:27   ` Li Zefan
2009-02-23  2:27 ` Li Zefan
2009-02-23  2:56   ` Li Zefan
     [not found]     ` <49A21044.40402-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2009-02-24  1:36       ` KAMEZAWA Hiroyuki
2009-02-24  1:36     ` KAMEZAWA Hiroyuki
     [not found]       ` <20090224103659.069e6b33.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2009-02-24  1:41         ` Li Zefan
2009-02-24  1:41       ` Li Zefan
     [not found]         ` <49A35048.3000304-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2009-02-24  1:47           ` KAMEZAWA Hiroyuki
2009-02-24  1:47         ` KAMEZAWA Hiroyuki
     [not found]   ` <49A20976.2050301-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2009-02-23  2:56     ` Li Zefan
  -- strict thread matches above, loose matches on Subject: below --
2009-02-20 10:02 KAMEZAWA Hiroyuki

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=49A34E72.1040609@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=containers@lists.linux-foundation.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.