Re: [PATCH 0/6] cgroup: add isolation_root flag, poor man's namespaces for cgroups

From: Witold Krecicki
Date: Thu Oct 20 2011 - 06:26:20 EST


Dnia czwartek, 20 paÅdziernika 2011 o 12:11:54 Paul Menage napisaÅ(a):
> After talking with Eric Biederman at LPC about the virtualizability of
> containers, I was wondering whether we could go even further, and say
> that a hierarchy (in the sense of a tree of cgroups with a bound set
> of subsystems) could be broken at the point of an isolation root. The
> container could then construct its own hierarchies with potentially
> different combinations of subsystems.
I tried to make it as simple as possible - and this approach (looking at patch
length) seemed to be the simplest (we really don't care about 'other' cgroups
that might appear). Other approaches would probably require major rewrites of
cgroups code.

> > I'm really not sure if the 'mount' part (patch 5) is done correctly,
> > please review carefully.
>
> It looks simple, I agree, and as though it *ought* to work. My first
> worry with this was that if the parent system unmount the hierarchy,
> and all the tasks in the child container died (so its namespace was
> cleaned up), what would keep the root or the parent-created hierarchy
> alive? But I think that since the super-block also has a reference on
> the root dentry itself, it should be OK.
I've tested it and 'it works' so no problem there :)
I'm currently testing this setup with several containers launched under
modified LXC (creating 'container_name' cgroup, then 'container_name/rootfs',
then setting them both to desired values and putting init in
'container_name/rootfs') - no problems so far.

--
Witold Krecicki


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/