Skip to contentSkip to conversation

cgroup: deprecate remount option changes and "name=" mount option

PATCH In review Tejun Heo 5 participants 13 messages Mar 14, 2012 – Mar 31, 2012 4 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Tejun Heo

author maintainer
#0 lore raw

PATCH 1/1 cgroup: deprecate remount option changes and "name=" mount option

This patch removes the following features.

* Rebinding subsys by remount: Never reached useful state - only works on empty hierarchies.

* release_agent update by remount: release_agent itself will be replaced with conventional fsnotify notification.

* "name=" mount option: This has been broken for years before Li fixed it recently. It has very marginal usefulness (plain bind mount can mostly replace it) and is quite unusual. Take the chance and mark for deprecation.

Cc Li Zefan <[email protected]>
Cc Lennart Poettering <[email protected]>

---
If you want these to survive, now is the time to scream. :)

Thanks.

 Documentation/feature-removal-schedule.txt |   12 ++++++++++++
 kernel/cgroup.c                            |   10 ++++++++++
 2 files changed, 22 insertions(+)
Documentation/feature-removal-schedule.txt +12 -0
Index: work/Documentation/feature-removal-schedule.txt
===================================================================
@@ -510,3 +510,15 @@ Why:	The pci_scan_bus_parented() interfa
 	convert to using pci_scan_root_bus() so they can supply a list of
 	bus resources when the bus is created.
 Who:	Bjorn Helgaas <[email protected]>
+
+----------------------------
+
+What:	cgroup option updates via remount, and "name=" mount option
+When:	March 2013
+Why:	Remount currently allows changing bound subsystems and
+	release_agent.  Rebinding is hardly useful as it only works
+	when the hierarchy is empty and release_agent itself should be
+	replaced with conventional fsnotify.  "name=" option allows
+	mounting existing hierarchy by its name, which isn't useful
+	and has been broken for years without anyone noticing.
+Who:	Tejun Heo <[email protected]>
kernel/cgroup.c +10 -0
Index: work/kernel/cgroup.c
===================================================================
@@ -1146,6 +1146,11 @@ static int parse_cgroupfs_options(char *
 		}
 		if (!strncmp(token, "name=", 5)) {
 			const char *name = token + 5;
+
+			/* See feature-removal-schedule.txt */
+			pr_warning("cgroup: name= option is deprecated (pid=%d comm=%s name=%s)\n",
+				   task_tgid_nr(current), current->comm, name);
+
 			/* Can't specify an empty name */
 			if (!strlen(name))
 				return -EINVAL;
@@ -1294,6 +1299,11 @@ static int cgroup_remount(struct super_b
 	if (ret)
 		goto out_unlock;
 
+	/* See feature-removal-schedule.txt */
+	if (opts.subsys_bits != root->actual_subsys_bits || opts.release_agent)
+		pr_warning("cgroup: option changes via remount are deprecated (pid=%d comm=%s)\n",
+			   task_tgid_nr(current), current->comm);
+
 	/* Don't allow flags or name to change at remount */
 	if (opts.flags != root->flags ||
 	    (opts.name && strcmp(opts.name, root->name))) {
#1 lore raw

On Wed, 14.03.12 14:52, Tejun Heo ([email protected]) wrote:

Heya,

Quoted 4 lines

* "name=" mount option: This has been broken for years before Li fixed it recently. It has very marginal usefulness (plain bind mount can mostly replace it) and is quite unusual. Take the chance and mark for deprecation.

Hmm, this is not clear to me. Are you intending to remove the name= mount option entirely, or just intend to remove that you can change it in remounts?

systemd uses name=systemd to get its own private cgroup tree, that has no controller bound, hence we kinda need this option. Or are you suggesting there was an other way to get a private cgroup tree that systemd can use for grouping and labelling things?

Lennart

Signature · 1 line
Lennart Poettering - Red Hat, Inc.
author maintainer
#2 lore raw

Hello,

Quoted 8 lines · Lennart Poettering

Hmm, this is not clear to me. Are you intending to remove the name= mount option entirely, or just intend to remove that you can change it in remounts?

systemd uses name=systemd to get its own private cgroup tree, that has no controller bound, hence we kinda need this option. Or are you suggesting there was an other way to get a private cgroup tree that systemd can use for grouping and labelling things?

Eh, you're right. I want to remove support for duplicate mounting by name or subsys as it just isn't necessary, so what I want is,

* "mount -t cgroupfs -o SUBSYS" will fail if SUBSYS is already mounted somewhere else.

* "mount -t cgroupfs -o none" will always create a new cgroup hierarchy w/o any controller attached.

I didn't realize that the mount code didn't allow none w/o name and now I don't see a non-intrusive way to remove the name option. :( Eh well, I'll drop that part.

Thanks.

Signature · 1 line
tejun
#3 lore raw
Quoted 19 lines · Tejun Heo

Hello,

Quoted 8 lines · Lennart Poettering

Hmm, this is not clear to me. Are you intending to remove the name= mount option entirely, or just intend to remove that you can change it in remounts?

systemd uses name=systemd to get its own private cgroup tree, that has no controller bound, hence we kinda need this option. Or are you suggesting there was an other way to get a private cgroup tree that systemd can use for grouping and labelling things?

Eh, you're right. I want to remove support for duplicate mounting by name or subsys as it just isn't necessary, so what I want is,

* "mount -t cgroupfs -o SUBSYS" will fail if SUBSYS is already mounted somewhere else.

Quoted 6 lines

* "mount -t cgroupfs -o none" will always create a new cgroup hierarchy w/o any controller attached.

I didn't realize that the mount code didn't allow none w/o name and now I don't see a non-intrusive way to remove the name option. :( Eh well, I'll drop that part.

Insisting on a name or controller (i.e. not allowing completely anonymous cgroupfs mounts) is probably a good idea since otherwise the data in /proc/$PID/cgroup might be a bit useless since you couldn't sensible match up the data in there with your mount point.

Multiple mounts of the same tree can go, as long as bind mounting is still supported so that we can make the cgroup tree available in limited form to containers and such.

Lennart

Signature · 1 line
Lennart Poettering - Red Hat, Inc.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw
Quoted 19 lines · Tejun Heo

Hello,

Quoted 8 lines · Lennart Poettering

Hmm, this is not clear to me. Are you intending to remove the name= mount option entirely, or just intend to remove that you can change it in remounts?

systemd uses name=systemd to get its own private cgroup tree, that has no controller bound, hence we kinda need this option. Or are you suggesting there was an other way to get a private cgroup tree that systemd can use for grouping and labelling things?

Eh, you're right. I want to remove support for duplicate mounting by name or subsys as it just isn't necessary, so what I want is,

* "mount -t cgroupfs -o SUBSYS" will fail if SUBSYS is already mounted somewhere else.

Quoted 6 lines

* "mount -t cgroupfs -o none" will always create a new cgroup hierarchy w/o any controller attached.

I didn't realize that the mount code didn't allow none w/o name and now I don't see a non-intrusive way to remove the name option. :( Eh well, I'll drop that part.

Insisting on a name or controller (i.e. not allowing completely anonymous cgroupfs mounts) is probably a good idea since otherwise the data in /proc/$PID/cgroup might be a bit useless since you couldn't sensible match up the data in there with your mount point.

Multiple mounts of the same tree can go, as long as bind mounting is still supported so that we can make the cgroup tree available in limited form to containers and such.

Lennart

Signature · 1 line
Lennart Poettering - Red Hat, Inc.

A message that is not in the archive (sent off-list or not yet received): 20120314232925.GA16973-kS5D54t9nk0aINubkmmoJbNAH6kLmebB@public.gmane.org

#7 lore raw

Hello,

Quoted 8 lines · Lennart Poettering

Hmm, this is not clear to me. Are you intending to remove the name= mount option entirely, or just intend to remove that you can change it in remounts?

systemd uses name=systemd to get its own private cgroup tree, that has no controller bound, hence we kinda need this option. Or are you suggesting there was an other way to get a private cgroup tree that systemd can use for grouping and labelling things?

Eh, you're right. I want to remove support for duplicate mounting by name or subsys as it just isn't necessary, so what I want is,

* "mount -t cgroupfs -o SUBSYS" will fail if SUBSYS is already mounted somewhere else.

* "mount -t cgroupfs -o none" will always create a new cgroup hierarchy w/o any controller attached.

I didn't realize that the mount code didn't allow none w/o name and now I don't see a non-intrusive way to remove the name option. :( Eh well, I'll drop that part.

Thanks.

Signature · 1 line
tejun

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw

On Wed, 14.03.12 14:52, Tejun Heo ([email protected]) wrote:

Heya,

Quoted 4 lines

* "name=" mount option: This has been broken for years before Li fixed it recently. It has very marginal usefulness (plain bind mount can mostly replace it) and is quite unusual. Take the chance and mark for deprecation.

Hmm, this is not clear to me. Are you intending to remove the name= mount option entirely, or just intend to remove that you can change it in remounts?

systemd uses name=systemd to get its own private cgroup tree, that has no controller bound, hence we kinda need this option. Or are you suggesting there was an other way to get a private cgroup tree that systemd can use for grouping and labelling things?

Lennart

Signature · 1 line
Lennart Poettering - Red Hat, Inc.
#10 lore raw
In reply to a message not in the archive
Quoted 7 lines · Tejun Heo

This patch removes the following features.

* Rebinding subsys by remount: Never reached useful state - only works on empty hierarchies.

* release_agent update by remount: release_agent itself will be replaced with conventional fsnotify notification.

meaning any applications currently relying on release agent will need to add a daemon using fsnotify? Or will it be done in the kernel?

thanks,
-serge

author maintainer
#11 lore raw

PATCH 1/1 cgroup: deprecate remount option changes mount option

In reply to Tejun Heo

This patch marks the following features for deprecation.

* Rebinding subsys by remount: Never reached useful state - only works on empty hierarchies.

* release_agent update by remount: release_agent itself will be replaced with conventional fsnotify notification.

v2: Lennart pointed out that "name=" is necessary for mounts w/o any
controller attached. Drop "name=" deprecation.

Cc Li Zefan <[email protected]>
Cc Lennart Poettering <[email protected]>
---
 Documentation/feature-removal-schedule.txt |   10 ++++++++++
 kernel/cgroup.c                            |    5 +++++
 2 files changed, 15 insertions(+)
Documentation/feature-removal-schedule.txt +10 -0
Index: work/Documentation/feature-removal-schedule.txt
===================================================================
@@ -510,3 +510,13 @@ Why:	The pci_scan_bus_parented() interfa
 	convert to using pci_scan_root_bus() so they can supply a list of
 	bus resources when the bus is created.
 Who:	Bjorn Helgaas <[email protected]>
+
+----------------------------
+
+What:	cgroup option updates via remount
+When:	March 2013
+Why:	Remount currently allows changing bound subsystems and
+	release_agent.  Rebinding is hardly useful as it only works
+	when the hierarchy is empty and release_agent itself should be
+	replaced with conventional fsnotify.
+Who:	Tejun Heo <[email protected]>
kernel/cgroup.c +5 -0
Index: work/kernel/cgroup.c
===================================================================
@@ -1294,6 +1294,11 @@ static int cgroup_remount(struct super_b
 	if (ret)
 		goto out_unlock;
 
+	/* See feature-removal-schedule.txt */
+	if (opts.subsys_bits != root->actual_subsys_bits || opts.release_agent)
+		pr_warning("cgroup: option changes via remount are deprecated (pid=%d comm=%s)\n",
+			   task_tgid_nr(current), current->comm);
+
 	/* Don't allow flags or name to change at remount */
 	if (opts.flags != root->flags ||
 	    (opts.name && strcmp(opts.name, root->name))) {
#12 lore raw

Re: [PATCH] cgroup: deprecate remount option changes mount option

Quoted 7 lines · Tejun Heo

This patch marks the following features for deprecation.

* Rebinding subsys by remount: Never reached useful state - only works on empty hierarchies.

* release_agent update by remount: release_agent itself will be replaced with conventional fsnotify notification.

Just wondering, what kind of event do you plan to emit if a cgroup runs empty? To userspace, with fanotify, will this be FAN_MODIFY? I'd very much prefer if we only get events really when a group runs empty, and not each time a PID is added/removed from a cgroup, which FAN_NOTIFY might suggest?

Lennart

Signature · 1 line
Lennart Poettering - Red Hat, Inc.
author maintainer
#13 lore raw

Re: [PATCH] cgroup: deprecate remount option changes mount option

Hello,

Quoted 8 lines · Lennart Poettering
Quoted 2 lines

* release_agent update by remount: release_agent itself will be replaced with conventional fsnotify notification.

Just wondering, what kind of event do you plan to emit if a cgroup runs empty? To userspace, with fanotify, will this be FAN_MODIFY? I'd very much prefer if we only get events really when a group runs empty, and not each time a PID is added/removed from a cgroup, which FAN_NOTIFY might suggest?

MODIFY probably is the only thing which makes sense and I don't think we would be emitting events for every task addition/removals. That better fits MODIFY events on the tasks file anyway.

Thanks.

Signature · 1 line
tejun
author maintainer
#14 lore raw

Re: [PATCH] cgroup: deprecate remount option changes mount option

In reply to Tejun Heo

Li, re-sending to your new address just in case you missed this one.

Quoted 53 lines · Tejun Heo

This patch marks the following features for deprecation.

* Rebinding subsys by remount: Never reached useful state - only works on empty hierarchies.

* release_agent update by remount: release_agent itself will be replaced with conventional fsnotify notification.

v2: Lennart pointed out that "name=" is necessary for mounts w/o any
controller attached. Drop "name=" deprecation.

Cc Li Zefan <[email protected]>
Cc Lennart Poettering <[email protected]>
---
 Documentation/feature-removal-schedule.txt |   10 ++++++++++
 kernel/cgroup.c                            |    5 +++++
 2 files changed, 15 insertions(+)

Index: work/Documentation/feature-removal-schedule.txt
===================================================================

Documentation/feature-removal-schedule.txt +10 -0
@@ -510,3 +510,13 @@ Why:	The pci_scan_bus_parented() interfa
 	convert to using pci_scan_root_bus() so they can supply a list of
 	bus resources when the bus is created.
 Who:	Bjorn Helgaas <[email protected]>
+
+----------------------------
+
+What:	cgroup option updates via remount
+When:	March 2013
+Why:	Remount currently allows changing bound subsystems and
+	release_agent.  Rebinding is hardly useful as it only works
+	when the hierarchy is empty and release_agent itself should be
+	replaced with conventional fsnotify.
+Who:	Tejun Heo <[email protected]>

Index: work/kernel/cgroup.c
===================================================================

kernel/cgroup.c +5 -0
@@ -1294,6 +1294,11 @@ static int cgroup_remount(struct super_b
 	if (ret)
 		goto out_unlock;
 
+	/* See feature-removal-schedule.txt */
+	if (opts.subsys_bits != root->actual_subsys_bits || opts.release_agent)
+		pr_warning("cgroup: option changes via remount are deprecated (pid=%d comm=%s)\n",
+			   task_tgid_nr(current), current->comm);
+
 	/* Don't allow flags or name to change at remount */
 	if (opts.flags != root->flags ||
 	    (opts.name && strcmp(opts.name, root->name))) {
Signature · 1 line
tejun

A message that is not in the archive (sent off-list or not yet received): [email protected]

#16 lore raw

Re: [PATCH] cgroup: deprecate remount option changes mount option

Li, re-sending to your new address just in case you missed this one.

Quoted 53 lines · Tejun Heo

This patch marks the following features for deprecation.

* Rebinding subsys by remount: Never reached useful state - only works on empty hierarchies.

* release_agent update by remount: release_agent itself will be replaced with conventional fsnotify notification.

v2: Lennart pointed out that "name=" is necessary for mounts w/o any
controller attached. Drop "name=" deprecation.

Cc Li Zefan <[email protected]>
Cc Lennart Poettering <[email protected]>
---
 Documentation/feature-removal-schedule.txt |   10 ++++++++++
 kernel/cgroup.c                            |    5 +++++
 2 files changed, 15 insertions(+)

Index: work/Documentation/feature-removal-schedule.txt
===================================================================

Documentation/feature-removal-schedule.txt +10 -0
@@ -510,3 +510,13 @@ Why:	The pci_scan_bus_parented() interfa
 	convert to using pci_scan_root_bus() so they can supply a list of
 	bus resources when the bus is created.
 Who:	Bjorn Helgaas <[email protected]>
+
+----------------------------
+
+What:	cgroup option updates via remount
+When:	March 2013
+Why:	Remount currently allows changing bound subsystems and
+	release_agent.  Rebinding is hardly useful as it only works
+	when the hierarchy is empty and release_agent itself should be
+	replaced with conventional fsnotify.
+Who:	Tejun Heo <[email protected]>

Index: work/kernel/cgroup.c
===================================================================

kernel/cgroup.c +5 -0
@@ -1294,6 +1294,11 @@ static int cgroup_remount(struct super_b
 	if (ret)
 		goto out_unlock;
 
+	/* See feature-removal-schedule.txt */
+	if (opts.subsys_bits != root->actual_subsys_bits || opts.release_agent)
+		pr_warning("cgroup: option changes via remount are deprecated (pid=%d comm=%s)\n",
+			   task_tgid_nr(current), current->comm);
+
 	/* Don't allow flags or name to change at remount */
 	if (opts.flags != root->flags ||
 	    (opts.name && strcmp(opts.name, root->name))) {
Signature · 1 line
tejun