[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6599ad830806271702y2c1df2edh3a75dda75336ddad@mail.gmail.com>
Date: Fri, 27 Jun 2008 17:02:35 -0700
From: "Paul Menage" <menage@...gle.com>
To: a.p.zijlstra@...llo.nl, maxk@...lcomm.com, pj@....com,
vegard.nossum@...il.com
Cc: linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH] CGroups: Add a per-subsystem hierarchy lock
On Fri, Jun 27, 2008 at 12:59 AM, Paul Menage <menage@...gle.com> wrote:
>
> This patch adds a hierarchy_mutex to the cgroup_subsys object that
> protects changes to the hierarchy observed by that subsystem. It is
> taken by the cgroup subsystem for the following operations:
>
> - linking a cgroup into that subsystem's cgroup tree
> - unlinking a cgroup from that subsystem's cgroup tree
> - moving the subsystem to/from a hierarchy (including across the
> bind() callback)
>
> Thus if the subsystem holds its own hierarchy_mutex, it can safely
> traverse its ts own hierarchy.
>
It struck me that there's a small race in this code now that we're not
doing cgroup_lock() in the hotplug path.
- we start to attach a task T to cpuset C, with a single CPU "X" in
its "cpus" list
- cpuset_can_attach() returns successfully since the cpuset has a cpu
- CPU X gets hot-unplugged; any tasks in C are moved to their parent
cpuset and C loses its cpu.
- we update T->cgroups to point to C, which is broken since C has no cpus.
So we'll need some additional locking work on top of this - but I
think this patch is still a step in the right direction.
Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists