Re: [RFC/RFT PATCH v3] sched: automated per tty task groups

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Tuesday, November 16, 2010 - 12:35 pm

On Tue, Nov 16, 2010 at 11:13 AM, Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:

Well, it's _currently_ CPU controller only. People have already
wondered if we should try to do something similar for IO scheduling
too.

So the thing I think is worth keeping in mind is that the "per-tty
scheduling group" is really just an implementation issue. There is
absolutely no question that it can't be about more than just
scheduling, and that it can't be about more than just tty's also.

And an important thing to keep in mind is that "user interfaces are
bad". The thinner the interface, the better. One of the reasons I
really like autogroup is that it has _no_ interface at all. It's very
much a heuristic, and it has zero user interface (apart from the knob
that turns it on and off, of course). That is a great feature, because
it means that you cannot break the interface. You will never need to
have applications that have special linux-specific hooks in them, or
system daemons who have to touch magical /proc files etc.

One of the problems I found annoying when just testing it using the
plain cgroup interface (before the patch) was the resource management.
You needed root, and they actually made sense requiring root, because
I don't think we _want_ to allow people creating infinite numbers of
cgroups. Vivek's "trivial patch" (shell script) is a major DoS thing,
for example. Letting normal users create cgroups willy-nilly is not a
good idea (and as Vivek already found out, his trivial script leaks
cgroups in a pretty fundamental way).

The tty approach is somewhat self-limiting in that it requires you to
get the tty to get an autogroup. But also, because it's very much a
heuristic and doesn't have any user-visible interfaces, from a kernel
perspective it's wonderful. There are no "semantics" to break. If it
turns out that there is some way to create excessive cgroups, we can
introduce per-user limits etc to say "the heuristic works up to X
cgroups and then you'll just get your own user group". And nobody
would ever notice.

So doing things automatically and without any user interface is about
_more_ than just convenience. If it can be done that way, it is
fundamentally better way to do things. Because it hides the
implementation details, and leaves us open to do totally different
things in the end.

For example, 'cgroups' itself is pretty heavy-weight, and is really
quite smart. Those things nest, etc etc. But with the "it's just a
heuristic", maybe somebody ends up doing a "simplified non-nesting
grouping thing", and if you don't want the whole cgroup thing (I have
always answered no to CONFIG_CGROUPS myself, for example), you could
still do the autogrouping. But you could _not_ cleanly do the
/proc/sys/cgroup/user scripting, because your implementation is no
longer based on the whole cgroups thing.

Now, will any of this ever happen? I dunno. I doubt it will matter.
But it's an example of why I think it's such a great approach, and why
"it just works" is such an important feature.

                       Linus

                       Linus
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC/RFT PATCH] sched: automated per tty task groups, Mike Galbraith, (Tue Oct 19, 2:16 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Peter Zijlstra, (Tue Oct 19, 2:26 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Peter Zijlstra, (Tue Oct 19, 2:29 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Mike Galbraith, (Tue Oct 19, 2:39 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Mike Galbraith, (Tue Oct 19, 2:42 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Peter Zijlstra, (Tue Oct 19, 2:43 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Mike Galbraith, (Tue Oct 19, 2:46 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Mike Galbraith, (Tue Oct 19, 4:29 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Mike Galbraith, (Tue Oct 19, 6:12 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Linus Torvalds, (Tue Oct 19, 8:28 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Mike Galbraith, (Tue Oct 19, 11:13 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Mike Galbraith, (Tue Oct 19, 11:53 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Markus Trippelsdorf, (Wed Oct 20, 6:55 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Mike Galbraith, (Wed Oct 20, 7:41 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Mike Galbraith, (Thu Oct 21, 12:55 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Mike Galbraith, (Thu Oct 21, 1:11 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Mike Galbraith, (Thu Oct 21, 1:39 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Markus Trippelsdorf, (Thu Oct 21, 1:48 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Mike Galbraith, (Thu Oct 21, 1:52 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Peter Zijlstra, (Thu Oct 21, 3:28 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Mathieu Desnoyers, (Thu Oct 21, 3:51 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Peter Zijlstra, (Thu Oct 21, 4:25 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Mike Galbraith, (Thu Oct 21, 4:27 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Mathieu Desnoyers, (Thu Oct 21, 9:22 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Oleg Nesterov, (Thu Oct 21, 9:29 am)
Re: [RFC/RFT PATCH] sched: automated per tty task groups, Mike Galbraith, (Thu Oct 21, 12:11 pm)
[RFC/RFT PATCH v3] sched: automated per tty task groups, Mike Galbraith, (Tue Oct 26, 12:07 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Mike Galbraith, (Tue Oct 26, 12:29 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Linus Torvalds, (Thu Nov 11, 11:34 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Mike Galbraith, (Thu Nov 11, 12:08 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Markus Trippelsdorf, (Thu Nov 11, 12:15 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Mike Galbraith, (Thu Nov 11, 12:35 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Linus Torvalds, (Thu Nov 11, 12:37 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Markus Trippelsdorf, (Thu Nov 11, 12:38 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Mike Galbraith, (Thu Nov 11, 12:58 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Mike Galbraith, (Sun Nov 14, 10:19 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Markus Trippelsdorf, (Sun Nov 14, 10:49 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Mike Galbraith, (Sun Nov 14, 11:10 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Linus Torvalds, (Sun Nov 14, 12:28 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Markus Trippelsdorf, (Sun Nov 14, 1:27 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Valdis.Kletnieks, (Mon Nov 15, 3:41 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Tue Nov 16, 10:03 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Linus Torvalds, (Tue Nov 16, 10:11 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Mike Galbraith, (Tue Nov 16, 10:42 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Peter Zijlstra, (Tue Nov 16, 11:08 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Tue Nov 16, 11:16 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Peter Zijlstra, (Tue Nov 16, 11:21 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Linus Torvalds, (Tue Nov 16, 11:49 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Peter Zijlstra, (Tue Nov 16, 11:59 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Peter Zijlstra, (Tue Nov 16, 12:13 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Peter Zijlstra, (Tue Nov 16, 12:25 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Linus Torvalds, (Tue Nov 16, 12:35 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Markus Trippelsdorf, (Tue Nov 16, 12:42 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Peter Zijlstra, (Tue Nov 16, 12:43 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Linus Torvalds, (Tue Nov 16, 12:45 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Linus Torvalds, (Tue Nov 16, 12:49 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Mike Galbraith, (Tue Nov 16, 12:57 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Tue Nov 16, 1:03 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Tue Nov 16, 1:05 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Tue Nov 16, 1:28 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Tue Nov 16, 1:31 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Tue Nov 16, 1:33 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Tue Nov 16, 1:36 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Tue Nov 16, 1:50 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Tue Nov 16, 2:08 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Tue Nov 16, 2:14 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Tue Nov 16, 2:17 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Tue Nov 16, 2:19 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Tue Nov 16, 5:21 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Wed Nov 17, 8:01 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Wed Nov 17, 3:34 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Wed Nov 17, 3:45 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Wed Nov 17, 4:49 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Hans-Peter Jansen, (Thu Nov 18, 3:33 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Samuel Thibault, (Thu Nov 18, 4:12 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Samuel Thibault, (Thu Nov 18, 4:43 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Samuel Thibault, (Thu Nov 18, 5:02 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Samuel Thibault, (Thu Nov 18, 5:07 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Samuel Thibault, (Thu Nov 18, 5:42 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Samuel Thibault, (Thu Nov 18, 5:59 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Samuel Thibault, (Thu Nov 18, 6:23 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Mathieu Desnoyers, (Thu Nov 18, 8:15 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Samuel Thibault, (Fri Nov 19, 2:02 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Mathieu Desnoyers, (Fri Nov 19, 5:55 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Mathieu Desnoyers, (Fri Nov 19, 6:20 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Samuel Thibault, (Fri Nov 19, 7:24 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Samuel Thibault, (Fri Nov 19, 7:55 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Fri Nov 19, 9:34 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Linus Torvalds, (Fri Nov 19, 10:51 am)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Mike Galbraith, (Fri Nov 19, 12:31 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Linus Torvalds, (Fri Nov 19, 12:48 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Fri Nov 19, 6:13 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Fri Nov 19, 6:33 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Sat Nov 20, 8:41 am)
[PATCH v4] sched: automated per session task groups, Mike Galbraith, (Sat Nov 20, 12:35 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Mike Galbraith, (Sat Nov 20, 12:47 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Mike Galbraith, (Sat Nov 20, 12:51 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Samuel Thibault, (Sat Nov 20, 1:25 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Konstantin Svist, (Sat Nov 20, 3:02 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Samuel Thibault, (Sat Nov 20, 3:15 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Thomas Fjellstrom, (Sat Nov 20, 3:18 pm)
Re: [RFC/RFT PATCH v3] sched: automated per tty task groups, Lennart Poettering, (Mon Nov 22, 12:21 pm)
[tip:sched/core] sched: Add 'autogroup' scheduling feature ..., tip-bot for Mike Gal ..., (Tue Nov 30, 8:39 am)
Re: [PATCH v4] sched: automated per session task groups, Colin Walters, (Sat Dec 4, 10:39 am)
Re: [PATCH v4] sched: automated per session task groups, Linus Torvalds, (Sat Dec 4, 11:33 am)
Re: [PATCH v4] sched: automated per session task groups, Colin Walters, (Sat Dec 4, 1:01 pm)
Re: [PATCH v4] sched: automated per session task groups, Linus Torvalds, (Sat Dec 4, 3:39 pm)
Re: [PATCH v4] sched: automated per session task groups, Colin Walters, (Sat Dec 4, 4:43 pm)
Re: [PATCH v4] sched: automated per session task groups, Linus Torvalds, (Sat Dec 4, 5:31 pm)
Re: [PATCH v4] sched: automated per session task groups, Nikos Chantziaras, (Sun Dec 5, 4:11 am)
Re: [PATCH v4] sched: automated per session task groups, Mike Galbraith, (Sun Dec 5, 4:36 am)
Re: [PATCH v4] sched: automated per session task groups, Colin Walters, (Sun Dec 5, 12:22 pm)
Re: [PATCH v4] sched: automated per session task groups, Linus Torvalds, (Sun Dec 5, 1:47 pm)
Re: [PATCH v4] sched: automated per session task groups, Colin Walters, (Sun Dec 5, 3:47 pm)
Re: [PATCH v4] sched: automated per session task groups, Valdis.Kletnieks, (Sun Dec 5, 5:28 pm)
Re: [PATCH v4] sched: automated per session task groups, Peter Zijlstra, (Tue Dec 7, 11:51 am)
[tip:sched/core] sched, autogroup: Fix potential access to ..., tip-bot for Mike Gal ..., (Tue Jan 4, 7:18 am)