Trying to reduce our memory and battery footprint

Ted Gould ted at ubuntu.com
Wed Oct 17 19:51:24 UTC 2012


On Wed, 2012-10-17 at 08:43 -0700, Steve Langasek wrote:
> On Wed, Oct 17, 2012 at 08:43:31AM -0500, Ted Gould wrote:
> > It was my understanding that we could get this by upstart putting all of
> > the processes in the user session in a cgroup for that user.  This would
> > require upstart to be the first process in the user session, but I think
> > that's achievable.  Is my understanding there incorrect?
> 
> No.  cgroups provide multi-process resource control and push-button reaping
> of a set of related processes; they don't change the Unix semantics of PID 1
> parent-of-last-resort handling, which is what we're talking about here. 
> Now, Lennart has pushed a kernel change to allow parent-of-last-resort
> delegation, but a) TTBOMK that's unrelated to cgroups, b) that would tie us
> to a bleeding-edge kernel interface, c) it's not clear that it's needed for
> what we're trying to achieve.

I guess I think the parent-of-last-resort is different than just simple
noticing when a task dies and restarting it.  For instance in[1] there
is this:

        If the notify_on_release flag is enabled (1) in a cgroup, then
        whenever the last task in the cgroup leaves (exits or attaches
        to some other cgroup) and the last child cgroup of that cgroup
        is removed, then the kernel runs the command specified by the
        contents of the "release_agent" file in that hierarchy's root
        directory, supplying the pathname (relative to the mount point
        of the cgroup file system) of the abandoned cgroup.  This
        enables automatic removal of abandoned cgroups.

Which it seems to me that if we created a cgroup of for instance Compiz,
if Compiz and all of its children were to die the cgroup would close and
upstart would get notified.  It could respond to that by respawing a new
cgroup with a new Compiz in it.

		--Ted

[1] http://www.kernel.org/doc/Documentation/cgroups/cgroups.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-desktop/attachments/20121017/9a20dd7a/attachment.pgp>


More information about the ubuntu-desktop mailing list