Re: [systemd-devel] [PATCH v2] cgroup-util: fix is_valid check to pass for unified cgroup hierchy.
On 1 June 2015 at 09:03, Umut Tezduyar Lindskog u...@tezduyar.com wrote: On Fri, May 29, 2015 at 12:25 PM, Lennart Poettering lenn...@poettering.net wrote: On Fri, 29.05.15 00:24, Dimitri John Ledkov (dimitri.j.led...@intel.com) wrote: On 28 May 2015 at 18:08, Lennart Poettering lenn...@poettering.net wrote: On Thu, 28.05.15 16:42, Dimitri John Ledkov (dimitri.j.led...@intel.com) wrote: It appears in /proc/self/cgroup as `0::/' What precisely does this fix? I mean, we need to do some major rework of things before the unified hierarchy is really supported in systemd, and this one thing won't really get us too much in this regard, does it? I'm starting to explore possibilities to start work towards supporting unified cgroups hierarchy, or at least be able to boot with it. I'll send a larger patch series in one go later than with all the bits that offer something more tangible, albeit disabled by default behind configure options (like kdbus) given that unified hierarchy is still marked experimental in the kernel. Ah, it's actually my big thing to work on for the next weeks too... What is the advantage of having a unified hierarchy, could you guys explain? There are a few. Read more in the linux documentation: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/Documentation/cgroups/unified-hierarchy.txt For me, I'm spending a lot of time during boot forking cgroups release agent user-space binary, which establishes IPC connection to systemd to notify that a cgroup was released. And essentially oneshot services during boot pay sequential price of executing two processes rather than just one. Hence exposure of cgroups.populated field is very desirable for me. Currently only available on the unified hierarchy, but I'm not sure why it couldn't be enabled on the old one, given that it is forward compatible. -- Regards, Dimitri. Pura Vida! https://clearlinux.org Open Source Technology Center Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH v2] cgroup-util: fix is_valid check to pass for unified cgroup hierchy.
On 29 May 2015 at 11:25, Lennart Poettering lenn...@poettering.net wrote: On Fri, 29.05.15 00:24, Dimitri John Ledkov (dimitri.j.led...@intel.com) wrote: On 28 May 2015 at 18:08, Lennart Poettering lenn...@poettering.net wrote: On Thu, 28.05.15 16:42, Dimitri John Ledkov (dimitri.j.led...@intel.com) wrote: It appears in /proc/self/cgroup as `0::/' What precisely does this fix? I mean, we need to do some major rework of things before the unified hierarchy is really supported in systemd, and this one thing won't really get us too much in this regard, does it? I'm starting to explore possibilities to start work towards supporting unified cgroups hierarchy, or at least be able to boot with it. I'll send a larger patch series in one go later than with all the bits that offer something more tangible, albeit disabled by default behind configure options (like kdbus) given that unified hierarchy is still marked experimental in the kernel. Ah, it's actually my big thing to work on for the next weeks too... My current priority is to port at least enough bits to get usable /sys/fs/cgroup/systemd on top of unified cgroups, with immediate benefit of dropping systemd-cgroups-agent and getting release notifications in containers. Not sure about transition / re-exec plan, at the moment I am assuming either/or situation but I guess we'd need to support a dual case, where upon re-exec we might still be in name=systemd rather than in the unified structure. -- Regards, Dimitri. Pura Vida! https://clearlinux.org Open Source Technology Center Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH v2] cgroup-util: fix is_valid check to pass for unified cgroup hierchy.
On Fri, 29.05.15 12:42, Dimitri John Ledkov (dimitri.j.led...@intel.com) wrote: On 29 May 2015 at 11:25, Lennart Poettering lenn...@poettering.net wrote: On Fri, 29.05.15 00:24, Dimitri John Ledkov (dimitri.j.led...@intel.com) wrote: On 28 May 2015 at 18:08, Lennart Poettering lenn...@poettering.net wrote: On Thu, 28.05.15 16:42, Dimitri John Ledkov (dimitri.j.led...@intel.com) wrote: It appears in /proc/self/cgroup as `0::/' What precisely does this fix? I mean, we need to do some major rework of things before the unified hierarchy is really supported in systemd, and this one thing won't really get us too much in this regard, does it? I'm starting to explore possibilities to start work towards supporting unified cgroups hierarchy, or at least be able to boot with it. I'll send a larger patch series in one go later than with all the bits that offer something more tangible, albeit disabled by default behind configure options (like kdbus) given that unified hierarchy is still marked experimental in the kernel. Ah, it's actually my big thing to work on for the next weeks too... My current priority is to port at least enough bits to get usable /sys/fs/cgroup/systemd on top of unified cgroups, with immediate benefit of dropping systemd-cgroups-agent and getting release notifications in containers. Not sure about transition / re-exec plan, at the moment I am assuming either/or situation but I guess we'd need to support a dual case, where upon re-exec we might still be in name=systemd rather than in the unified structure. My intention is to make this all work so that we can support both modes for a while, but you have to pick at boot-time which mode you want: the unified hierarchy or the classic one. And if we pick the former you won't get the latter, and if you pick the latter you won't get the former. And yeah, getting proper notifications especially for the container case is the most important thing for me too. Lennart -- Lennart Poettering, Red Hat ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH v2] cgroup-util: fix is_valid check to pass for unified cgroup hierchy.
On 29 May 2015 at 14:41, Lennart Poettering lenn...@poettering.net wrote: On Fri, 29.05.15 12:42, Dimitri John Ledkov (dimitri.j.led...@intel.com) wrote: On 29 May 2015 at 11:25, Lennart Poettering lenn...@poettering.net wrote: On Fri, 29.05.15 00:24, Dimitri John Ledkov (dimitri.j.led...@intel.com) wrote: On 28 May 2015 at 18:08, Lennart Poettering lenn...@poettering.net wrote: On Thu, 28.05.15 16:42, Dimitri John Ledkov (dimitri.j.led...@intel.com) wrote: It appears in /proc/self/cgroup as `0::/' What precisely does this fix? I mean, we need to do some major rework of things before the unified hierarchy is really supported in systemd, and this one thing won't really get us too much in this regard, does it? I'm starting to explore possibilities to start work towards supporting unified cgroups hierarchy, or at least be able to boot with it. I'll send a larger patch series in one go later than with all the bits that offer something more tangible, albeit disabled by default behind configure options (like kdbus) given that unified hierarchy is still marked experimental in the kernel. Ah, it's actually my big thing to work on for the next weeks too... My current priority is to port at least enough bits to get usable /sys/fs/cgroup/systemd on top of unified cgroups, with immediate benefit of dropping systemd-cgroups-agent and getting release notifications in containers. Not sure about transition / re-exec plan, at the moment I am assuming either/or situation but I guess we'd need to support a dual case, where upon re-exec we might still be in name=systemd rather than in the unified structure. My intention is to make this all work so that we can support both modes for a while, but you have to pick at boot-time which mode you want: the unified hierarchy or the classic one. And if we pick the former you won't get the latter, and if you pick the latter you won't get the former. And yeah, getting proper notifications especially for the container case is the most important thing for me too. Right. I have it as compile option at the moment, and i'm booting fresh VMs with it. I do something rather crazy at the moment - mount /sys/fs/cgroup/systemd as unified hiearchy whilst keeping the old controller mounts where they are. Will add the bits for the inotify watches and then publish an RFC patch set. This way systemd gains the notification benefit straight away, whilst keeping the rest as it was essentially. I take it the unitfied structure is expected to be mounted in /sys/fs/cgroup/ direct, once stable. -- Regards, Dimitri. Pura Vida! https://clearlinux.org Open Source Technology Center Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH v2] cgroup-util: fix is_valid check to pass for unified cgroup hierchy.
Lennart Poettering [2015-05-29 17:02 +0200]: I'd really just introduce a new kernel cmdline option: systemd.debug-unified-cgroup=1 or so. A simple boolean that gets you either one or the other behaviour. Maybe make the default for this setting configurable with a configure script switch. And I'd include the debug in the name, to indicate that this is just for testing for now, and is an option that will go away eventually. How does that play with containers? Is it just that you can't switch on the unified hierarchy as long as you still have containers with older systemd versions which don't support that yet? That would be a bit ugly, but bearable, I guess, and it'll sort itself out over time. Or are there any worse issues there? Martin -- Martin Pitt| http://www.piware.de Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org) ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH v2] cgroup-util: fix is_valid check to pass for unified cgroup hierchy.
On Fri, 29.05.15 17:09, Martin Pitt (martin.p...@ubuntu.com) wrote: Lennart Poettering [2015-05-29 17:02 +0200]: I'd really just introduce a new kernel cmdline option: systemd.debug-unified-cgroup=1 or so. A simple boolean that gets you either one or the other behaviour. Maybe make the default for this setting configurable with a configure script switch. And I'd include the debug in the name, to indicate that this is just for testing for now, and is an option that will go away eventually. How does that play with containers? Is it just that you can't switch on the unified hierarchy as long as you still have containers with older systemd versions which don't support that yet? That would be a bit ugly, but bearable, I guess, and it'll sort itself out over time. IIUC a container manager could actually support old userspace in containers on a system that otherwise uses the unified hierarchy. THis is because even with the unified hierarchy in place you can still set up additional, named hierarchies. You'd hence mount an otherwise empty name=systemd hierarchied in your container manager and pass that to the container, and not mount anything else (especially no controller hierarchies). For the container everything should be as usual. Unfortunately this requires configuration though: you have to tell your container manager how to set things up, this cannot be set up in a way so that that old userspace magically gets the right classic cgroup setup, while new userspace magically gets the new cgroup setip... Lennart -- Lennart Poettering, Red Hat ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH v2] cgroup-util: fix is_valid check to pass for unified cgroup hierchy.
On Fri, 29.05.15 15:52, Dimitri John Ledkov (dimitri.j.led...@intel.com) wrote: And yeah, getting proper notifications especially for the container case is the most important thing for me too. Right. I have it as compile option at the moment, and i'm booting fresh VMs with it. I do something rather crazy at the moment - mount /sys/fs/cgroup/systemd as unified hiearchy whilst keeping the old controller mounts where they are. Will add the bits for the inotify watches and then publish an RFC patch set. This way systemd gains the notification benefit straight away, whilst keeping the rest as it was essentially. I take it the unitfied structure is expected to be mounted in /sys/fs/cgroup/ direct, once stable. I'd rather not support half-way implementations like that. I'd really just introduce a new kernel cmdline option: systemd.debug-unified-cgroup=1 or so. A simple boolean that gets you either one or the other behaviour. Maybe make the default for this setting configurable with a configure script switch. And I'd include the debug in the name, to indicate that this is just for testing for now, and is an option that will go away eventually. Lennart -- Lennart Poettering, Red Hat ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH v2] cgroup-util: fix is_valid check to pass for unified cgroup hierchy.
On Thu, 28.05.15 16:42, Dimitri John Ledkov (dimitri.j.led...@intel.com) wrote: It appears in /proc/self/cgroup as `0::/' What precisely does this fix? I mean, we need to do some major rework of things before the unified hierarchy is really supported in systemd, and this one thing won't really get us too much in this regard, does it? --- v2 change: Test for unified cgroup should pass irrespective of whether allow_named is set. src/shared/cgroup-util.c| 4 src/test/test-cgroup-util.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/shared/cgroup-util.c b/src/shared/cgroup-util.c index c0b0ca4..eda7523 100644 --- a/src/shared/cgroup-util.c +++ b/src/shared/cgroup-util.c @@ -1616,6 +1616,10 @@ bool cg_controller_is_valid(const char *p, bool allow_named) { if (!p) return false; +/* Unified cgroup */ +if (*p == 0) +return true; + if (allow_named) { s = startswith(p, name=); if (s) diff --git a/src/test/test-cgroup-util.c b/src/test/test-cgroup-util.c index 4a89f64..015d3d7 100644 --- a/src/test/test-cgroup-util.c +++ b/src/test/test-cgroup-util.c @@ -247,7 +247,8 @@ static void test_controller_is_valid(void) { assert_se(cg_controller_is_valid(foobar, false)); assert_se(cg_controller_is_valid(foo_bar, false)); assert_se(cg_controller_is_valid(name=foo, true)); -assert_se(!cg_controller_is_valid(, false)); +assert_se(cg_controller_is_valid(, true)); +assert_se(cg_controller_is_valid(, false)); assert_se(!cg_controller_is_valid(name=, true)); assert_se(!cg_controller_is_valid(=, false)); assert_se(!cg_controller_is_valid(cpu,cpuacct, false)); -- 2.1.4 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel Lennart -- Lennart Poettering, Red Hat ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH v2] cgroup-util: fix is_valid check to pass for unified cgroup hierchy.
On 28 May 2015 at 18:08, Lennart Poettering lenn...@poettering.net wrote: On Thu, 28.05.15 16:42, Dimitri John Ledkov (dimitri.j.led...@intel.com) wrote: It appears in /proc/self/cgroup as `0::/' What precisely does this fix? I mean, we need to do some major rework of things before the unified hierarchy is really supported in systemd, and this one thing won't really get us too much in this regard, does it? I'm starting to explore possibilities to start work towards supporting unified cgroups hierarchy, or at least be able to boot with it. I'll send a larger patch series in one go later than with all the bits that offer something more tangible, albeit disabled by default behind configure options (like kdbus) given that unified hierarchy is still marked experimental in the kernel. Regards, Dimitri. --- v2 change: Test for unified cgroup should pass irrespective of whether allow_named is set. src/shared/cgroup-util.c| 4 src/test/test-cgroup-util.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/shared/cgroup-util.c b/src/shared/cgroup-util.c index c0b0ca4..eda7523 100644 --- a/src/shared/cgroup-util.c +++ b/src/shared/cgroup-util.c @@ -1616,6 +1616,10 @@ bool cg_controller_is_valid(const char *p, bool allow_named) { if (!p) return false; +/* Unified cgroup */ +if (*p == 0) +return true; + if (allow_named) { s = startswith(p, name=); if (s) diff --git a/src/test/test-cgroup-util.c b/src/test/test-cgroup-util.c index 4a89f64..015d3d7 100644 --- a/src/test/test-cgroup-util.c +++ b/src/test/test-cgroup-util.c @@ -247,7 +247,8 @@ static void test_controller_is_valid(void) { assert_se(cg_controller_is_valid(foobar, false)); assert_se(cg_controller_is_valid(foo_bar, false)); assert_se(cg_controller_is_valid(name=foo, true)); -assert_se(!cg_controller_is_valid(, false)); +assert_se(cg_controller_is_valid(, true)); +assert_se(cg_controller_is_valid(, false)); assert_se(!cg_controller_is_valid(name=, true)); assert_se(!cg_controller_is_valid(=, false)); assert_se(!cg_controller_is_valid(cpu,cpuacct, false)); -- 2.1.4 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel Lennart -- Lennart Poettering, Red Hat -- Regards, Dimitri. Pura Vida! https://clearlinux.org Open Source Technology Center Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH v2] cgroup-util: fix is_valid check to pass for unified cgroup hierchy.
Patchset imported to github. Pull request: https://github.com/systemd-devs/systemd/compare/master...systemd-mailing-devs:1432827774-10868-1-git-send-email-dimitri.j.ledkov%40intel.com -- Generated by https://github.com/haraldh/mail2git ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel