cgroup: deprecate remount option changes and "name=" mount option
Subsystems (2)
Tejun Heo
maintainerPATCH 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.
---
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
@@ -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
@@ -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_bif (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))) {
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.
Tejun Heo
maintainerHello,
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
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]
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
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]
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.
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_agentupdate by remount:release_agentitself 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
Tejun Heo
maintainerPATCH 1/1 cgroup: deprecate remount option changes mount option
In reply to Tejun HeoThis 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.
--- Documentation/feature-removal-schedule.txt | 10 ++++++++++ kernel/cgroup.c | 5 +++++ 2 files changed, 15 insertions(+)
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]>
kernel/cgroup.c +5 -0
@@ -1294,6 +1294,11 @@ static int cgroup_remount(struct super_bif (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))) {
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_agentupdate by remount:release_agentitself 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.
Tejun Heo
maintainerRe: [PATCH] cgroup: deprecate remount option changes mount option
Hello,
Quoted 8 lines · Lennart Poettering
Quoted 2 lines
*
release_agentupdate by remount:release_agentitself 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, whichFAN_NOTIFYmight 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
Tejun Heo
maintainerRe: [PATCH] cgroup: deprecate remount option changes mount option
In reply to Tejun HeoLi, 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_agentupdate by remount:release_agentitself 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.Signed-off-by Tejun Heo <[email protected]>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_bif (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]
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_agentupdate by remount:release_agentitself 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.Signed-off-by Tejun Heo <[email protected]>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_bif (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