OpenVZ Forum - RDF feed
type: channel
items: [RFC] Prefixing cgroup generic control filenames with "cgroup."
items: Re: [RFC] Prefixing cgroup generic control filenames with "cgroup."
items: [RFC] [PATCH] Re: Prefixing cgroup generic control filenames with "cgroup."
items: Re: [RFC] [PATCH] Re: Prefixing cgroup generic control filenames with "cgroup."

[RFC] Prefixing cgroup generic control filenames with "cgroup."
type: item
description: All control files created by cgroup subsystems are given a prefix corresponding to their subsystem name. But control files provided by cgroups itself have no prefix. Currently that set of files is just "tasks", "notify_on_release" and "release_agent", but that set is likely to expand in the future. To reduce the risk of clashes, it would make sense to prefix these files and any future ones with the "cgroup." prefix. The only reason that I can see *not* to do this would be for compatibility with 2.6.24. Do people think this is a strong enough reason to leave the existing names? If distros are planning to ship products based on 2.6.24, presumably they'd be adding their own patches anyway, so they could add a trivial prefix change patch too. (I realise this discussion would have been more useful *before* 2.6.24 shipped, but I didn't quite get round to it ...) A compromise might be to keep "tasks" unprefixed, and say that future names get the "cgroup." prefix; in this case I'd be inclined to add the prefix to notify_on_release and release_agent on the grounds that there's much less chance of breaking anyone with those files since (I suspect) they're much less used. Note that if you mount a cgroup filesystem with the "noprefix" option, which is what the cpuset filesystem wrapper does, no subsystems have prefixes, and in this case the "cgroup." prefix wouldn't be used either. So this doesn't affect any users that explicitly mount cpusets rather than cgroups. Thoughts? Paul _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers
creator: Paul Menage
date: 2008-02-28T21:14:05-00:00

Re: [RFC] Prefixing cgroup generic control filenames with "cgroup."
type: item
description: On Thu, 28 Feb 2008 13:14:05 -0800 "Paul Menage" <menage@google.com> wrote: > All control files created by cgroup subsystems are given a prefix > corresponding to their subsystem name. But control files provided by > cgroups itself have no prefix. Currently that set of files is just > "tasks", "notify_on_release" and "release_agent", but that set is > likely to expand in the future. To reduce the risk of clashes, it > would make sense to prefix these files and any future ones with the > "cgroup." prefix. > > The only reason that I can see *not* to do this would be for > compatibility with 2.6.24. Do people think this is a strong enough > reason to leave the existing names? If distros are planning to ship > products based on 2.6.24, presumably they'd be adding their own > patches anyway, so they could add a trivial prefix change patch too. > (I realise this discussion would have been more useful *before* 2.6.24 > shipped, but I didn't quite get round to it ...) > > A compromise might be to keep "tasks" unprefixed, and say that future > names get the "cgroup." prefix; in this case I'd be inclined to add > the prefix to notify_on_release and release_agent on the grounds that > there's much less chance of breaking anyone with those files since (I > suspect) they're much less used. > > Note that if you mount a cgroup filesystem with the "noprefix" option, > which is what the cpuset filesystem wrapper does, no subsystems have > prefixes, and in this case the "cgroup." prefix wouldn't be used > either. So this doesn't affect any users that explicitly mount cpusets > rather than cgroups. > > Thoughts? > It would be easier to judge if we could see the full directory tree. Because if something is in /foo/bar/cgroup/notify_on_release then prefixing the filename with "cgroup_" seems pretty pointless. _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers
creator: akpm
date: 2008-02-28T21:21:42-00:00

Re: [RFC] Prefixing cgroup generic control filenames with "cgroup."
type: item
description: On Thu, Feb 28, 2008 at 1:21 PM, Andrew Morton <akpm@linux-foundation.org> wrote: > > Because if something is in /foo/bar/cgroup/notify_on_release then > prefixing the filename with "cgroup_" seems pretty pointless. > The point would be to avoid situations where a user has code that creates a group directory called "foo", and then in a future kernel release cgroups introduces a control file called "foo". If it's prefixed, then the user just has to avoid creating groups prefixed by "cgroup." or any subsystem name, so collisions will be less likely. Paul _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers
creator: Paul Menage
date: 2008-02-28T21:28:31-00:00

Re: [RFC] Prefixing cgroup generic control filenames with "cgroup."
type: item
description: Quoting Paul Menage (menage@google.com): > All control files created by cgroup subsystems are given a prefix > corresponding to their subsystem name. But control files provided by > cgroups itself have no prefix. Currently that set of files is just > "tasks", "notify_on_release" and "release_agent", but that set is > likely to expand in the future. To reduce the risk of clashes, it > would make sense to prefix these files and any future ones with the > "cgroup." prefix. > > The only reason that I can see *not* to do this would be for > compatibility with 2.6.24. Do people think this is a strong enough > reason to leave the existing names? If distros are planning to ship > products based on 2.6.24, presumably they'd be adding their own > patches anyway, so they could add a trivial prefix change patch too. > (I realise this discussion would have been more useful *before* 2.6.24 > shipped, but I didn't quite get round to it ...) > > A compromise might be to keep "tasks" unprefixed, and say that future > names get the "cgroup." prefix; in this case I'd be inclined to add > the prefix to notify_on_release and release_agent on the grounds that > there's much less chance of breaking anyone with those files since (I > suspect) they're much less used. > > Note that if you mount a cgroup filesystem with the "noprefix" option, > which is what the cpuset filesystem wrapper does, no subsystems have > prefixes, and in this case the "cgroup." prefix wouldn't be used > either. So this doesn't affect any users that explicitly mount cpusets > rather than cgroups. > > Thoughts? To me it seems quite logical that files belonging to the cgroup subsystem would have no prefix, and I don't see any good reason to do so. -serge _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers
creator: serge
date: 2008-02-28T21:28:35-00:00

Re: [RFC] Prefixing cgroup generic control filenames with "cgroup."
type: item
description: Quoting Paul Menage (menage@google.com): > On Thu, Feb 28, 2008 at 1:21 PM, Andrew Morton > <akpm@linux-foundation.org> wrote: > > > > > Because if something is in /foo/bar/cgroup/notify_on_release then > > prefixing the filename with "cgroup_" seems pretty pointless. > > > > The point would be to avoid situations where a user has code that > creates a group directory called "foo", and then in a future kernel > release cgroups introduces a control file called "foo". If it's > prefixed, then the user just has to avoid creating groups prefixed by > "cgroup." or any subsystem name, so collisions will be less likely. Have you already run into that case? You said the set of files belong to cgroup itself is likely to increase - do you have some candidates in mind? Perhaps ones which are likely to conflict with choice taskgroup names? If anything I'd say add a 'prefix_cgroup' mount option and use it to decide whether to prefix or not (rather than use the noprefix option). -serge _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers
creator: serge
date: 2008-02-28T21:33:19-00:00

Re: [RFC] Prefixing cgroup generic control filenames with "cgroup."
type: item
description: On Thu, 28 Feb 2008 13:28:31 -0800 "Paul Menage" <menage@google.com> wrote: > On Thu, Feb 28, 2008 at 1:21 PM, Andrew Morton > <akpm@linux-foundation.org> wrote: > > > > > Because if something is in /foo/bar/cgroup/notify_on_release then > > prefixing the filename with "cgroup_" seems pretty pointless. > > > > The point would be to avoid situations where a user has code that > creates a group directory called "foo", and then in a future kernel > release cgroups introduces a control file called "foo". If it's > prefixed, then the user just has to avoid creating groups prefixed by > "cgroup." or any subsystem name, so collisions will be less likely. > Maybe cgroups shouldn't be putting kernel-generated files in places where user-specified files appear? (Am still thrashing around a bit here without an overview of the overall layout and naming). _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers
creator: akpm
date: 2008-02-28T21:40:27-00:00

Re: [RFC] Prefixing cgroup generic control filenames with "cgroup."
type: item
description: On Thu, Feb 28, 2008 at 1:40 PM, Andrew Morton <akpm@linux-foundation.org> wrote: > > Maybe cgroups shouldn't be putting kernel-generated files in places where > user-specified files appear? > Well, that API (mixing control files and group directories in the same directory namespace) was inherited directly from cpusets. It wouldn't be hard to throw that away and move all the user-created group directories into their own subdirectory, i.e. change the existing directory layout from something like: /mnt/cgroup/ tasks cpu.shares memory.limit_in_bytes memory.usage_in_bytes user_created_groupname1/ tasks cpu.shares memory.limit_in_bytes memory.usage_in_bytes user_created_groupname2/ tasks cpu.shares memory.limit_in_bytes memory.usage_in_bytes to something like: /mnt/cgroup/ tasks cpu.shares memory.limit_in_bytes memory.usage_in_bytes groups/ user_created_groupname1/ tasks cpu.shares memory.limit_in_bytes memory.usage_in_bytes groups/ user_created_groupname2/ tasks cpu.shares memory.limit_in_bytes memory.usage_in_bytes groups/ That would completely solve the namespace problem, at the cost of a little extra verbosity/inelegance for human users (I suspect programmatic users would prefer it), and lack of compatibility with 2.6.24. I'd also need to make the existing model a mount option so that we could keep compatibility with the cpusets filesystem API. > (Am still thrashing around a bit here without an overview of the overall > layout and naming). Pretty much the same as cpusets, other than the additional kernel-generated files in each directory, as provided by the resource subsystems. So the same potential problem faced cpusets, but the fact that new cpuset features weren't being developed quickly meant the problem was less likely to actually bite people. Paul _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers
creator: Paul Menage
date: 2008-02-28T22:06:30-00:00

Re: [RFC] Prefixing cgroup generic control filenames with "cgroup."
type: item
description: On Thu, Feb 28, 2008 at 1:33 PM, <serge@hallyn.com> wrote: > > You said the set of files belong to cgroup itself is likely to increase > - do you have some candidates in mind? Nothing concrete right now. One example that I already proposed was the "cgroup.api" file but that's shelved for now, until such time as I actually propose the binary API that it was intended to help support. > Perhaps ones which are likely > to conflict with choice taskgroup names? It's hard to determine what likely taskgroup names would be. For my own use, pretty much every group has a unique 64-bit ID in the name so this isn't something I worry about directly affecting our systems. But I don't know what other users might want to do. > > If anything I'd say add a 'prefix_cgroup' mount option and use it to > decide whether to prefix or not (rather than use the noprefix option). The existing "noprefix" option controls whether the *subsystems* get prefixes. It's mainly there to provide backwards compatibility for cpusets. Existing cpusets clients would be expecting to find files with names like "mems_allowed" rather than "cpuset.mems_allowed". So mounting with the "noprefix" option (which happens automatically when you mount the "cpuset" filesystem wrapper) gives the same result as before. Currently "noprefix" has no effect on cgroup files, since they never have a prefix anyway. Yes, we could add a new mount option "prefixcgroup", and let people decide which they want. But I still don't see any argument *against* doing the prefixing automatically (rather than an argument that it's no better or worse) other than wanting 2.6.24 compatibility. Paul _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers
creator: Paul Menage
date: 2008-02-28T22:06:44-00:00

Re: [RFC] Prefixing cgroup generic control filenames with "cgroup."
type: item
description: On Thu, 28 Feb 2008 14:06:30 -0800 "Paul Menage" <menage@google.com> wrote: > On Thu, Feb 28, 2008 at 1:40 PM, Andrew Morton > <akpm@linux-foundation.org> wrote: > > > > Maybe cgroups shouldn't be putting kernel-generated files in places where > > user-specified files appear? > > > > Well, that API (mixing control files and group directories in the same > directory namespace) was inherited directly from cpusets. > > It wouldn't be hard to throw that away and move all the user-created > group directories into their own subdirectory, i.e. change the > existing directory layout from something like: > > /mnt/cgroup/ > tasks > cpu.shares > memory.limit_in_bytes > memory.usage_in_bytes > user_created_groupname1/ > tasks > cpu.shares > memory.limit_in_bytes > memory.usage_in_bytes > user_created_groupname2/ > tasks > cpu.shares > memory.limit_in_bytes > memory.usage_in_bytes > > to something like: > > /mnt/cgroup/ > tasks > cpu.shares > memory.limit_in_bytes > memory.usage_in_bytes > groups/ > user_created_groupname1/ > tasks > cpu.shares > memory.limit_in_bytes > memory.usage_in_bytes > groups/ > user_created_groupname2/ > tasks > cpu.shares > memory.limit_in_bytes > memory.usage_in_bytes > groups/ That looks nice. > That would completely solve the namespace problem, at the cost of a > little extra verbosity/inelegance for human users (I suspect > programmatic users would prefer it), and lack of compatibility with > 2.6.24. I'd also need to make the existing model a mount option so > that we could keep compatibility with the cpusets filesystem API. That doesn't. It sounds like cpusets legacy has mucked us up here? Could we do something like auto-prefixing user-created directories with a fixed string so that there is no way in which the user can cause a collision with kernel-created files? I suppose that would break cpusets back-compatibility as well? If so, we could do the prefixing only for non-cpusets directories, but that's getting a bit weird. > > (Am still thrashing …
creator: akpm
date: 2008-02-28T22:21:00-00:00

Re: [RFC] Prefixing cgroup generic control filenames with "cgroup."
type: item
description: On Thu, Feb 28, 2008 at 2:21 PM, Andrew Morton <akpm@linux-foundation.org> wrote: > On Thu, 28 Feb 2008 14:06:30 -0800 > > "Paul Menage" <menage@google.com> wrote: > > > > > On Thu, Feb 28, 2008 at 1:40 PM, Andrew Morton > > <akpm@linux-foundation.org> wrote: > > > > > > Maybe cgroups shouldn't be putting kernel-generated files in places where > > > user-specified files appear? > > > > > > > Well, that API (mixing control files and group directories in the same > > directory namespace) was inherited directly from cpusets. > > > > It wouldn't be hard to throw that away and move all the user-created > > group directories into their own subdirectory, i.e. change the > > existing directory layout from something like: > > > > /mnt/cgroup/ > > tasks > > cpu.shares > > memory.limit_in_bytes > > memory.usage_in_bytes > > user_created_groupname1/ > > tasks > > cpu.shares > > memory.limit_in_bytes > > memory.usage_in_bytes > > user_created_groupname2/ > > tasks > > cpu.shares > > memory.limit_in_bytes > > memory.usage_in_bytes > > > > to something like: > > > > /mnt/cgroup/ > > tasks > > cpu.shares > > memory.limit_in_bytes > > memory.usage_in_bytes > > groups/ > > user_created_groupname1/ > > tasks > > cpu.shares > > memory.limit_in_bytes > > memory.usage_in_bytes > > groups/ > > user_created_groupname2/ > > tasks > > cpu.shares > > memory.limit_in_bytes > > memory.usage_in_bytes > > groups/ > > That looks nice. > I'll put a patch together for consideration. > Could we do something like auto-prefixing user-created directories with a > fixed string so that there is no way in which the user can cause a > collision with kernel-created files? That's something like putting them all in their own sub-directory, but sounds less clean to me. > > I suppose that would break cpusets back-compatibility as well? If so, we > could do the prefixing only for non-cpusets directories, but that's getting > a bit weird. We already have something like that in place, actually. When you mount the l…
creator: Paul Menage
date: 2008-02-28T22:26:39-00:00

Re: [RFC] Prefixing cgroup generic control filenames with "cgroup."
type: item
description: Paul M wrote: > But control files provided by > cgroups itself have no prefix. Currently that set of files is just > "tasks", "notify_on_release" and "release_agent", but that set is > likely to expand in the future. To reduce the risk of clashes, it > would make sense to prefix these files and any future ones with the > "cgroup." prefix. I don't see the mixing of kernel generated filenames with user generated names to be a practical problem. There just aren't that many names in play here. I'd think that renaming even the few cgroup files that were published in 2.6.24 would be a fairly unacceptable incompatibility. Paul M wrote: > The point would be to avoid situations where a user has code that > creates a group directory called "foo", and then in a future kernel > release cgroups introduces a control file called "foo". We could accomplish that much by decreeing that future new kernel generated names that we might add follow some stronger convention, such as the cgroup_ or appropriate subsystem prefix. No need to change the existing well known names for this reason. Serge wrote: > To me it seems quite logical that files belonging to the cgroup > subsystem would have no prefix, and I don't see any good reason to > do so. Agreed. Paul M wrote: > It wouldn't be hard to throw that away and move all the user-created > group directories into their own subdirectory, i.e. change the > existing directory layout from something like: Yuck. You're complicating this more than necessary, to solve a problem that exists only in your imagination ;). Simple, overlapping, namespaces really are ok, so long as the number of distinct names and the rate of their growth are sufficiently low. > But I don't know what other users might want to do. Just set some convention for future added names; that's enough to enable others adding user space names to avoid collisions. Such as using only lower case letters and underscores, or the cgroup_ or other prefix on -future- names. That's sufficient,…
creator: Paul Jackson
date: 2008-02-28T23:36:18-00:00

Re: [RFC] Prefixing cgroup generic control filenames with "cgroup."
type: item
description: On Thu, Feb 28, 2008 at 3:36 PM, Paul Jackson <pj@sgi.com> wrote: > > We could accomplish that much by decreeing that future new kernel > generated names that we might add follow some stronger convention, > such as the cgroup_ or appropriate subsystem prefix. Subsystem-created files already have an appropriate prefix. > No need to > change the existing well known names for this reason. But that's part of my point - is it reasonable to describe a system that was only introduced in 2.6.24 as "well-known"? > > Actually, in terms of 'common names used > by humans' some of these names, "tasks" and "notify_on_release", date > back much earlier than that. Please don't rename these two files in > cgroups; and of course absolutely don't rename them in cpusets. No, I wasn't planning to make any changes to cpusets. > > Please don't end up with different names of these files, depending on > whether you're in cgroups or cpusets, either. That already happens - when mounted as the "cpuset" filesystem, we have names like "mems_allowed". When mounted as cgroups, we have names like cpuset.mems_allowed. > > > Could we do something like auto-prefixing user-created directories with a > > fixed string so that there is no way in which the user can cause a > > collision with kernel-created files? > > Lordy lordy -- a bunch of intrusive, complicating crap to solve a > non-existent problem (sorry for the indelicate choice of words ;). No, I don't like that idea either. Paul _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers
creator: Paul Menage
date: 2008-02-29T01:03:33-00:00

Re: [RFC] Prefixing cgroup generic control filenames with "cgroup."
type: item
description: > Subsystem-created files already have an appropriate prefix. Good ... such little consistencies in naming are helpful, when voluntarily self imposed, without incompatible changes to published names. > > No need to > > change the existing well known names for this reason. > > But that's part of my point - is it reasonable to describe a system > that was only introduced in 2.6.24 as "well-known"? In their earlier cpuset context, "tasks" and "notify_on_release" have been well known for years. And breaking actual compatibility, in a way that will break more than the tiniest set of users, even over one release, should not be done without both (1) a really good cause, and (2) a plan for migrating users over a couple of releases to the new interface. > > back much earlier than that. Please don't rename these two files in > > cgroups; and of course absolutely don't rename them in cpusets. > > No, I wasn't planning to make any changes to cpusets. Yeah - I figured you wouldn't risk my wrath changing this in cpusets ;). Could you please not change them in cgroups, either? > > Please don't end up with different names of these files, depending on > > whether you're in cgroups or cpusets, either. > > That already happens - when mounted as the "cpuset" filesystem, we > have names like "mems_allowed". When mounted as cgroups, we have names > like cpuset.mems_allowed. Ok - it does make sense that cpuset specific files, when embedded in the more general purpose cgroups, are adorned with name prefixes that they didn't have in the legacy API. And besides, it is what is -- we released it, and there's no compelling disaster forcing a change. But generic cgroup infrastructure files, such as "tasks", have not had such adornments. And now, that is what it is -- released, and sufficient to remain as it is. > No, I don't like that idea either. Good (and extra credit for saying so with fewer words and more politely than I managed ;). -- I won't rest till it's the best ... Programmer, Linux Sc…
creator: Paul Jackson
date: 2008-02-29T01:22:32-00:00

[RFC] [PATCH] Re: Prefixing cgroup generic control filenames with "cgroup."
type: item
description: >> to something like: >> > >> > /mnt/cgroup/ >> > tasks >> > cpu.shares >> > memory.limit_in_bytes >> > memory.usage_in_bytes >> > groups/ >> > user_created_groupname1/ >> > tasks >> > cpu.shares >> > memory.limit_in_bytes >> > memory.usage_in_bytes >> > groups/ >> > user_created_groupname2/ >> > tasks >> > cpu.shares >> > memory.limit_in_bytes >> > memory.usage_in_bytes >> > groups/ > > That looks nice. > OK, here's a patch that does that. It's not quite right yet, as it crashes on unmount, but the basic idea is there. It adds the additional "groups" directory by default, but uses the previous behaviour if the nogroupdir option is passed (done by default for cpusets). Thoughts? Is this a direction we want to go in? As an option, or by default? Paul include/linux/cgroup.h | 2 kernel/cgroup.c | 164 +++++++++++++++++++++++++++++++++++-------------- kernel/cpuset.c | 2 3 files changed, 122 insertions(+), 46 deletions(-) Index: subdir-2.6.25-rc3/include/linux/cgroup.h =================================================================== --- subdir-2.6.25-rc3.orig/include/linux/cgroup.h +++ subdir-2.6.25-rc3/include/linux/cgroup.h @@ -105,7 +105,7 @@ struct cgroup { struct cgroup *parent; /* my parent */ struct dentry *dentry; /* cgroup fs entry */ - + struct dentry *group_dentry; /* Private pointers for each registered subsystem */ struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; Index: subdir-2.6.25-rc3/kernel/cgroup.c =================================================================== --- subdir-2.6.25-rc3.orig/kernel/cgroup.c +++ subdir-2.6.25-rc3/kernel/cgroup.c @@ -139,6 +139,7 @@ inline int cgroup_is_removed(const struc /* bits in struct cgroupfs_root flags field */ enum { ROOT_NOPREFIX, /* mounted subsystems have no named prefix */ + ROOT_NOGROUPDIR, /* user-created sub-groups go in the main directory */ }; static int cgroup_is_releasable(const struct cgroup *cgrp) @@ -475,6 +476,16 @@ static struct css_set *find_css_set( return res; } +static inline struct…
creator: Paul Menage
date: 2008-02-29T05:59:21-00:00

Re: [RFC] [PATCH] Re: Prefixing cgroup generic control filenames with "cgroup."
type: item
description: Paul M wrote: > Thoughts? Is this a direction we want to go in? As an option, or by default? So ... this proposal adds a 'groups' subdirectory in each cgroup, and places the user generated subgroups in there. It looks like an unnecessary, incompatible and complicating change to me. For example, what would have been cgroup: /mnt/cgroup/user_created_groupname1/user_created_groupname2 now becomes: /mnt/cgroup/cgroups/user_created_groupname1/cgroups/user_created_groupname2 Right? Why would you do this? There is no problem with the current implementation, no bug we're having trouble coding a fix for, no feature we're have trouble adding. The current code, that simply doesn't allow colliding user names because the kernel provided names are already there, works just fine. You're doing this just to "protect the user from themself", to make it more difficult for them to rely on some name that in a future version is no longer available. It annoys users, and rightfully so, to have to permanently deal with interface warts, because the computer is trying to protect the user from some hypothetical scenario that is not a problem the user needs solving. There is really a trivial resolution to this ... stake out what additional kernel generated names might ever be added ... some pattern(s) of characters which all future names will match, which leave wide swaths of names safely available, in perpetuity, for user created names, with no risk of future collision. And did I say incompatible with released versions? Hopefully Paul M isn't too surprised that I'm not endorsing this one ;). -- I won't rest till it's the best ... Programmer, Linux Scalability Paul Jackson <pj@sgi.com> 1.940.382.4214 _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers
creator: Paul Jackson
date: 2008-02-29T06:20:51-00:00

Re: [RFC] [PATCH] Re: Prefixing cgroup generic control filenames with "cgroup."
type: item
description: On Thu, Feb 28, 2008 at 10:20 PM, Paul Jackson <pj@sgi.com> wrote: > > For example, what would have been cgroup: > > /mnt/cgroup/user_created_groupname1/user_created_groupname2 > > now becomes: > > /mnt/cgroup/cgroups/user_created_groupname1/cgroups/user_created_groupname2 > > Right? Well, the additional components are called "groups" not "cgroups", but basically yes. > > You're doing this just to "protect the user from themself", to make > it more difficult for them to rely on some name that in a future > version is no longer available. Correct. "Future-proofing" and "Forward planning" are two alternatively-nuanced ways of describing this ... > > There is really a trivial resolution to this ... stake out what > additional kernel generated names might ever be added ... some > pattern(s) of characters which all future names will match, which > leave wide swaths of names safely available, in perpetuity, for > user created names, with no risk of future collision. Yes, we could just say "the kernel reserves the right to use any names that begin with a lower-case letter, and no others", and be done with it. That leaves a bit of an ugly taste in my mouth, but if people seem to prefer that approach we can go for it. > > And did I say incompatible with released versions? Not at all incompatible if it requires a mount option to enable it ... Paul _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers
creator: Paul Menage
date: 2008-02-29T09:34:37-00:00

Re: [RFC] Prefixing cgroup generic control filenames with "cgroup."
type: item
description: Paul Menage ??????: > ... > > A compromise might be to keep "tasks" unprefixed, and say that future > names get the "cgroup." prefix; in this case I'd be inclined to add > the prefix to notify_on_release and release_agent on the grounds that > there's much less chance of breaking anyone with those files since (I > suspect) they're much less used. > This makes most sense to me. It won't break any existing software (most likely) while it seems reasonable to leave 'tasks' unprefixed as this is something that any software using any subsystem of cgroup would be using anyway and it is not that much associated with a particulat subsystem. Regards, Peter Litov. _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers
creator: xpl
date: 2008-02-29T11:38:20-00:00

Re: [RFC] [PATCH] Re: Prefixing cgroup generic control filenames with "cgroup."
type: item
description: Paul M wrote: > Well, the additional components are called "groups" not "cgroups", but > basically yes. Ah yes - "groups" - right, sorry: /mnt/cgroup/groups/user_created_groupname1/groups/user_created_groupname2 > Yes, we could just say "the kernel reserves the right to use any names > that begin with a lower-case letter, and no others", and be done with > it. The pattern might be stronger (more restrictive) than "[a-z].*" The pattern might be something like: 1) the known set of existing names (a short, specific list), plus 2) "[a-z]+\.[a-z]+(_[a-z]+)*" That second pattern is some lower case letters, a dot, and some more lower case letters, possibly with some embedded underscores. That is, except for the grandfathered existing known names, such as "tasks", you would be promising that all names added in the future would look like the examples (for some string of lower case letters "subsys"): subsys.foo subsys.bar_baz or for cgroup infrastructure names (using "kern" or "groups" prefix, I don't have a clear preference): groups.stuff groups.this_and_that Then for instance any name (not already in use) that had either (1) no embedded dot '.', or (2) at least one character other than "[a-z_.]+", or (3) other variants too numerous to list, would be safe for user created group names. Or, for a simpler and more restrictive regex pattern, don't allow underscores, resulting in all kernel generated names matching: 1) the known list, or 2) "[a-z]+\.[a-z]+" Note here "safe for user created" names just means safe from collision with kernel generated names, not necessarily safe from collision with other user generated names. That is regardless of what you do here, you cannot protect the delicate user from possible collision. You can only protect them from collision with "your" names. This risks imposing extra complexity on users just so you can avoid being blamed for the name collisions they might still experience anyway. When I phrase it that way, my enthusiasm for this proposal w…
creator: Paul Jackson
date: 2008-02-29T15:30:13-00:00

Re: [RFC] [PATCH] Re: Prefixing cgroup generic control filenames with "cgroup."
type: item
description: On Fri, Feb 29, 2008 at 7:30 AM, Paul Jackson <pj@sgi.com> wrote: > > The pattern might be stronger (more restrictive) than "[a-z].*" > > The pattern might be something like: > 1) the known set of existing names (a short, specific list), plus > 2) "[a-z]+\.[a-z]+(_[a-z]+)*" Why make it more complex? If we're going for a solution that involves an implicit partition of the namespace that the user has to be aware of, then simple is good. > Note here "safe for user created" names just means safe from collision > with kernel generated names, not necessarily safe from collision with > other user generated names. > > That is regardless of what you do here, you cannot protect the > delicate user from possible collision. You can only protect them > from collision with "your" names. Of course - I don't think anyone's suggesting that the kernel can do anything about two competing users fighting over who gets to create cgroup "Foo". But IMO it's crazy to have multiple uncoordinated userspace cgroup managers. > > > And did I say incompatible with released versions? > > > > Not at all incompatible if it requires a mount option to enable it ... > > Ah - are you saying I missed another detail? That was one of the questions that I left open - we could add it defaulting to off, unless a mount option was given. > > /mnt/cgroup/groups/user_created_groupname1/groups/user_created_groupname2 > or > > /mnt/cgroup/user_created_groupname1/user_created_groupname2 Correct. > > So code that knows something about these paths has to work with either > form (since not all code using these paths will control the mount > relevant option.) Yes, but compared to all the other configuration details that a userspace cgroup manager needs to work with, I think this would be a minor one. > > I hope I misunderstood something here. > > > > That leaves a bit of an ugly taste in my mouth ... > > Could you spell out the key reason -you- find it distasteful, perhaps > for a stronger pattern such as "[a-z]+\.[a-z]…
creator: Paul Menage
date: 2008-02-29T17:59:00-00:00

Re: [RFC] [PATCH] Re: Prefixing cgroup generic control filenames with "cgroup."
type: item
description: > > 2) "[a-z]+\.[a-z]+(_[a-z]+)*" > > Why make it more complex? It's a trade-off, between how many names the pattern covers, and how complicated it is. I don't really have a preference between "[a-z].*", "[a-z]+\.[a-z_]+", or other variants. This sort of namespace partitioning is common in other venues, such as one or two leading underscores in various C or Python names having particular 'system' uses. Perhaps 90% of users who ever are in a position to construct a name in the cgroup namespace won't worry much about this one way or the other. For them, the strlen() of the regex pattern describing future possible kernel generated cgroup names won't matter. A few such constructors of cgroup names will appreciate the precision of whatever rule you create. > The main reason it's not my primary choice is that it's an implicit > rule that the user has to know about or risk getting bitten in future. Ok - as I suspected. Note again, you can't keep the user from getting bitten. You can only avoid being one of the biters. >From the users perspective, since you can't actually eliminate the risk of them ever seeing a collision, any complexity that you impose on their code risks being viewed as your taxing them more for your benefit (avoiding any blame to you) than for their benefit (actually avoiding all collision risk, which we can't practically do.) All name spaces co-operatively maintained in the commons have this risk of collision. As such name spaces go, the cgroup name space is easy. It's a small world. A few simple lexical conventions should suffice. I'd suggest something like you promise to stay in the "[a-z]+\.[a-z_]+" space, where the leading "[a-z]+" prefix is "cgroup" or one of a modest, slowly growing, set of cgroup subsystems, plus the existing grand-fathered names. Nothing here keeps others from intruding in that same space; you would just be promising not to go outside of that space. Self-imposed restraint like this "sells" better. The vast majority can just pay …
creator: Paul Jackson
date: 2008-02-29T19:20:57-00:00

Re: [RFC] Prefixing cgroup generic control filenames with "cgroup."
type: item
description: Xpl++ wrote: > Paul Menage ??????: >> ... >> >> A compromise might be to keep "tasks" unprefixed, and say that future >> names get the "cgroup." prefix; in this case I'd be inclined to add >> the prefix to notify_on_release and release_agent on the grounds that >> there's much less chance of breaking anyone with those files since (I >> suspect) they're much less used. >> > This makes most sense to me. It won't break any existing software > (most likely) while it seems reasonable to leave 'tasks' unprefixed as > this is something that any software using any subsystem of cgroup > would be using anyway and it is not that much associated with a > particulat subsystem. > And it makes most sense to me too, though I still doubt name collision will be a problem. _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers
creator: Li Zefan
date: 2008-03-03T07:23:51-00:00

Re: [RFC] Prefixing cgroup generic control filenames with "cgroup."
type: item
description: On Thu, Feb 28, 2008 at 2:06 PM, Paul Menage <menage@google.com> wrote: > On Thu, Feb 28, 2008 at 1:33 PM, <serge@hallyn.com> wrote: > > > > You said the set of files belong to cgroup itself is likely to increase > > - do you have some candidates in mind? > > Nothing concrete right now. One example that I already proposed was > the "cgroup.api" file but that's shelved for now, until such time as I > actually propose the binary API that it was intended to help support. > One likely new file that people agreed a while ago could be useful would be a "procs" file, similar to "tasks", but acting (and reporting) on thread groups rather than individual tasks. Paul _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers
creator: Paul Menage
date: 2008-03-03T08:38:16-00:00

Re: [RFC] Prefixing cgroup generic control filenames with "cgroup."
type: item
description: So, there have been various options suggested over the course of this thread: -- 1) no code changes, just stake out all names matching a certain regexp (e.g. "[a-z].*") as being potentially used by the kernel in the future; document this, and let users who are worried about name clashes avoid these names pros: no work involved, avoids potentially complex changes to solve a possibly non-problem. cons: leaves an intermingled namespace; since this would be a convention rather than an enforced rule, users might be unaware that they're setting themselves up for a fall -- 2) separate out the kernel-generated names and user-generated names by putting the user-generated names in a "groups" sub-directory (can be a mount option that's automatically disabled for cpusets). pros: completely solves problem of intermingled namespaces; makes it easier to see sub-groups at a glance cons: extra code, slightly more awkward to deal with in the general case, is incompatible with the code that was in mainline in the brief period of time since 2.6.24 was finalized. -- 3) prefix all cgroup-provided files with "cgroup." pros: hardly any extra code; mostly solves the namespace problem since user names are much less likely to begin with "cgroup." cons: changes name of "tasks" file visible in 2.6.24; doesn't help if a future new subsystem is introduced with a commonly-used name that might clash with existing user-generated names. -- 4) prefix all future cgroup files with "cgroup." (possibly including existing notify_on_release and release_agent files?) pros: no extra code, just involves slightly longer strings for future new files; no incompatibility issues cons: ugly inconsistency between new cgroup files and grandfathered old ones, plus same clash problems as option 3 -- Paul _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers
creator: Paul Menage
date: 2008-03-03T09:11:51-00:00

Re: [RFC] Prefixing cgroup generic control filenames with "cgroup."
type: item
description: Paul Menage wrote: > On Thu, Feb 28, 2008 at 2:06 PM, Paul Menage <menage@google.com> wrote: >> On Thu, Feb 28, 2008 at 1:33 PM, <serge@hallyn.com> wrote: >> > >> > You said the set of files belong to cgroup itself is likely to increase >> > - do you have some candidates in mind? >> >> Nothing concrete right now. One example that I already proposed was >> the "cgroup.api" file but that's shelved for now, until such time as I >> actually propose the binary API that it was intended to help support. >> > > One likely new file that people agreed a while ago could be useful > would be a "procs" file, similar to "tasks", but acting (and > reporting) on thread groups rather than individual tasks. > > Paul Yes, I remember this. This feature would be extremely useful. -- Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers
creator: Balbir Singh
date: 2008-03-03T09:59:29-00:00

Re: [RFC] Prefixing cgroup generic control filenames with "cgroup."
type: item
description: Paul M wrote (quoted by Li Zefan): >> A compromise might be to keep "tasks" unprefixed, and say that future >> names get the "cgroup." prefix; Another stray idea, for the master of stray ideas ;), how about (1) renaming all the cgroup files as you like, Paul M, even including tasks to cgroup.tasks or whatever, and then (2) adding symlinks for the legacy names, such as: tasks -> cgroup.tasks -- I won't rest till it's the best ... Programmer, Linux Scalability Paul Jackson <pj@sgi.com> 1.940.382.4214 _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers
creator: Paul Jackson
date: 2008-03-05T01:24:36-00:00