From: "Paul Menage" <menage@google.com>
To: a.p.zijlstra@chello.nl, maxk@qualcomm.com, pj@sgi.com,
vegard.nossum@gmail.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] CGroups: Add a per-subsystem hierarchy lock
Date: Fri, 27 Jun 2008 17:02:35 -0700 [thread overview]
Message-ID: <6599ad830806271702y2c1df2edh3a75dda75336ddad@mail.gmail.com> (raw)
In-Reply-To: <20080627075912.92AE43D6907@localhost>
On Fri, Jun 27, 2008 at 12:59 AM, Paul Menage <menage@google.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
next prev parent reply other threads:[~2008-06-28 0:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-27 7:59 Paul Menage
2008-06-28 0:02 ` Paul Menage [this message]
2008-07-02 3:55 ` Max Krasnyansky
2008-07-02 22:31 ` Paul Menage
2008-07-03 4:46 ` Max Krasnyansky
2008-07-10 17:26 ` Max Krasnyansky
2008-07-11 0:32 ` Paul Menage
2008-07-12 22:48 ` Max Krasnyansky
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=6599ad830806271702y2c1df2edh3a75dda75336ddad@mail.gmail.com \
--to=menage@google.com \
--cc=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=maxk@qualcomm.com \
--cc=pj@sgi.com \
--cc=vegard.nossum@gmail.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
all inboxes | Powered by JetHome®