From: Mike Galbraith <efault@gmx.de>
To: Vivek Goyal <vgoyal@redhat.com>
Cc: Paul Turner <pjt@google.com>, Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Linus Torvalds <torvalds@linux-foundation.org>,
Oleg Nesterov <oleg@redhat.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4] sched: automated per session task groups
Date: Wed, 01 Dec 2010 06:57:48 +0100 [thread overview]
Message-ID: <1291183068.7466.140.camel@marge.simson.net> (raw)
In-Reply-To: <20101130193622.GF26758@redhat.com>
On Tue, 2010-11-30 at 14:36 -0500, Vivek Goyal wrote:
> Few things.
>
> - This /proc/<pid>/autogroup is good for doing this single thing but when
> I start thinking of possible extensions of it down the line, it creates
> issues.
>
> - Once we have some kind of uppper limit support in cpu controller, these
> autogroups are beyond control. If you want to impose some kind of
> limits on them then you shall have to extend parallel interface
> /proc/<pid>/autogroup to also speicify upper limit (like nice levels).
>
> - Similiarly if this autgroup notion is extended to other cgroup
> controllers, then you shall have to again extend /proc/<pid>/autogroup
> to be able to specify these additional parameters.
Yes, if it evolves, it's interface will need to evolve as well. It
could have been a directory containing buttons, knobs and statistics,
but KISS won.
> - If there is a monitoring tool which is monitoring the system for
> resource usage by the groups, then I think these autogroups are beyond
> reach and any stats exported by cgroup interface will not be available.
> (though right now I can't see any stats being exported by cgroup files
> in cpu controller but other controllers like block and memory do.).
If you're manually assigning bandwidth et al from userland, there's not
much point to in-kernel automation is there?
If I had married the two, the first thing that would have happened is
gripes about things appearing and disappearing in cgroups directories,
resulting in mayhem and confusion for scripts and tools.
> - I am doing some testing with the patch and w.r.t. cgroup interface some
> things don't seem right.
>
> I have applied your patch and enabled CONFIG_AUTO_GROUP. Now I boot
> into the kernel and open a new ssh connection to the machine.
>
> # echo $$
> 3555
> # cat /proc/3555/autogroup
> /autogroup-63 nice 0
>
> IIUC, task 3555 has been moved into an autogroup. Now I mount the cpu
> controller and this task is visible in root cgroup.
>
> # mount -t cgroup -o cpu none /cgroup/cpu
> # cat /cgroup/cpu/tasks | grep 3555
> 3555
>
> First of all this gives user a wrong impression that task 3555 is in
> root cgroup.
It is in the root cgroup. It is not in the root autogroup is not
auto-cgroups group.
> Now I create a child group test1 and move the task there and also change
> the weight/shares of the cgroup to 10240.
>
> # mkdir test1
> # echo 3555 > test1/tasks
> # echo 10240 > test1/cpu.shares
> # cat /proc/3555/cgroup
> 3:cpu:/test1
> # cat /proc/3555/autogroup
> /autogroup-63 nice 0
>
> So again, user will think that task is in cgroup test1 and is being
> controlled by the respective weight but that's not the case.
It is the case here.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ P COMMAND
7573 root 20 0 7996 340 256 R 50 0.0 3:35.86 3 pert
7572 root 20 0 7996 340 256 R 50 0.0 9:21.68 3 pert
...
marge:/cgroups/test # echo 7572 > tasks
marge:/cgroups/test # echo 4096 > cpu.shares
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ P COMMAND
7572 root 20 0 7996 340 256 R 80 0.0 10:06.92 3 pert
7573 root 20 0 7996 340 256 R 20 0.0 4:05.80 3 pert
When you move a task into a cgroup, it still has an autogroup
association, as all tasks (processes actually) do, but it's not used.
> Even if we prevent autogroup task from being visible in cpu controller
> root group, then comes the question what happens if cpu and some other
> controller is comounted. Say cpuset. Now in that case will task be
> visible in root group task file and can one operate on that. Now showing
> up there does not make much sense as task should still be controllable
> by other controllers and its policies.
The user has to specifically ask for it in his config, can turn it on or
off on the fly or at boot..
> So yes, creating a /proc/<pid>/autogroup is dirt cheap and makes the life
> easier in terms of implementation of this patch and it should work well.
> But it is also a new user interface which does not sound too extensible and
> does not seem to cooperate well with cgroup interface
..it has a different mission, with different users being targeted, so
why does it need to hold hands?
> It also introduces this new notion of niceness for task groups which is sort
> of equivalent to cpu.shares in cpu controller. First of all why should we
> not stick to shares notion even for autogroup. Even if we introduce the notion
> of niceness for groups, IMHO, it should be through cgroup interface instead of
> group niceness for autogroup and shares/weights for cgroup despite the
> fact that in the background they do similar things.
IMHO, cgroups should have been 'nice' from the start, but the folks who
wrote it did what they thought best. I like nice a lot better than
shares, so I used nice.
> I think above concerns can possibly be reason enough to think about about
> the wedding.
Perhaps in future, they'll get married, and perhaps they should, but in
the here and now, I think they have similar but not identical missions.
If you turn on one, turn off the other. Maybe that should be automated.
Systemd thingy may make autogroup short lived anyway. I had a query
from an embedded guy (hm, which I spaced) suggesting autogroup may be
quite nice for handheld stuff though, so who knows.
-Mike
next prev parent reply other threads:[~2010-12-01 5:57 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-21 13:37 Ingo Molnar
2010-11-21 13:39 ` Ingo Molnar
2010-11-21 15:44 ` Oleg Nesterov
2010-11-21 16:35 ` Mike Galbraith
2010-11-21 16:15 ` Mike Galbraith
2010-11-21 18:43 ` Gene Heskett
2010-11-25 16:00 ` Mike Galbraith
2010-11-28 14:24 ` Mike Galbraith
2010-11-28 19:31 ` Linus Torvalds
2010-11-28 20:18 ` Ingo Molnar
2010-11-29 11:53 ` Peter Zijlstra
2010-11-29 12:30 ` Ingo Molnar
2010-11-29 13:45 ` Mike Galbraith
2010-11-29 13:47 ` Ingo Molnar
2010-11-29 14:04 ` Mike Galbraith
2010-11-29 16:27 ` Linus Torvalds
2010-11-29 16:44 ` Ingo Molnar
2010-11-29 17:37 ` Peter Zijlstra
2010-11-29 18:03 ` Ingo Molnar
2010-11-29 19:06 ` Mike Galbraith
2010-11-29 19:20 ` Ingo Molnar
2010-11-30 3:39 ` Paul Turner
2010-11-30 4:14 ` Mike Galbraith
2010-11-30 4:23 ` Paul Turner
2010-11-30 13:18 ` Mike Galbraith
2010-11-30 13:48 ` Peter Zijlstra
2010-11-30 13:59 ` Ingo Molnar
2010-11-30 14:13 ` Ingo Molnar
2010-11-30 16:41 ` Mike Galbraith
2010-11-30 15:17 ` Vivek Goyal
2010-11-30 17:13 ` Mike Galbraith
2010-11-30 19:36 ` Vivek Goyal
2010-12-01 5:01 ` Américo Wang
2010-12-01 6:09 ` Mike Galbraith
2010-12-01 11:36 ` Peter Zijlstra
2010-12-01 22:12 ` Valdis.Kletnieks
2010-12-01 5:57 ` Mike Galbraith [this message]
2010-12-01 11:33 ` Peter Zijlstra
2010-12-01 11:55 ` Mike Galbraith
2010-12-01 14:55 ` Vivek Goyal
2010-12-01 15:04 ` Mike Galbraith
2010-11-30 7:54 ` Mike Galbraith
2010-11-30 14:18 ` Ingo Molnar
2010-11-30 14:53 ` Ingo Molnar
2010-11-30 15:01 ` Peter Zijlstra
2010-11-30 15:11 ` Ingo Molnar
2010-11-30 16:28 ` Mike Galbraith
2010-11-29 5:45 ` Mike Galbraith
2010-12-01 3:39 ` Paul Turner
2010-12-01 3:39 ` Paul Turner
2010-12-01 6:16 ` Mike Galbraith
2010-12-03 5:11 ` Paul Turner
2010-12-03 6:48 ` Mike Galbraith
2010-12-03 8:37 ` Paul Turner
2010-12-04 23:55 ` James Courtier-Dutton
2010-12-05 5:11 ` Paul Turner
2010-12-07 11:32 ` Paul Turner
2010-12-15 12:10 ` Paul Turner
2010-12-01 11:34 ` Peter Zijlstra
-- strict thread matches above, loose matches on Subject: below --
2010-11-15 1:13 [RFC/RFT PATCH v3] sched: automated per tty " Mike Galbraith
2010-11-15 8:57 ` Peter Zijlstra
2010-11-15 11:32 ` Mike Galbraith
2010-11-15 11:46 ` Mike Galbraith
2010-11-15 12:57 ` Oleg Nesterov
2010-11-15 21:25 ` Mike Galbraith
2010-11-16 13:04 ` Oleg Nesterov
2010-11-16 14:18 ` Mike Galbraith
2010-11-16 15:03 ` Oleg Nesterov
2010-11-16 15:41 ` Mike Galbraith
2010-11-16 17:28 ` Ingo Molnar
2010-11-20 19:35 ` [PATCH v4] sched: automated per session " Mike Galbraith
2010-12-04 17:39 ` Colin Walters
2010-12-04 18:33 ` Linus Torvalds
2010-12-04 20:01 ` Colin Walters
2010-12-04 22:39 ` Linus Torvalds
2010-12-04 23:43 ` Colin Walters
2010-12-05 0:31 ` Linus Torvalds
2010-12-05 7:47 ` Ray Lee
2010-12-05 19:22 ` Colin Walters
2010-12-05 20:47 ` Linus Torvalds
2010-12-05 22:47 ` Colin Walters
2010-12-05 22:58 ` Jesper Juhl
2010-12-05 23:05 ` Jesper Juhl
2010-12-07 18:51 ` Peter Zijlstra
2010-12-05 10:18 ` Con Kolivas
2010-12-05 11:36 ` Mike Galbraith
2010-12-05 20:58 ` Ingo Molnar
2010-12-04 23:31 ` david
2010-12-05 11:11 ` Nikos Chantziaras
2010-12-06 0:28 ` Valdis.Kletnieks
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1291183068.7466.140.camel@marge.simson.net \
--to=efault@gmx.de \
--cc=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=oleg@redhat.com \
--cc=pjt@google.com \
--cc=torvalds@linux-foundation.org \
--cc=vgoyal@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome