From: Paul Menage <menage@google.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
bblum@google.com, ebiederm@xmission.com, lizf@cn.fujitsu.com,
matthltc@us.ibm.com
Subject: Re: + cgroups-add-functionality-to-read-write-lock-clone_thread-forking-pe r-threadgroup.patch added to -mm tree
Date: Sat, 22 Aug 2009 06:28:04 -0700 [thread overview]
Message-ID: <6599ad830908220628o7dc99cf1i5908d3e95deb31e5@mail.gmail.com> (raw)
In-Reply-To: <20090822130952.GA4240@redhat.com>
On Sat, Aug 22, 2009 at 6:09 AM, Oleg Nesterov<oleg@redhat.com> wrote:
>
>
> And why do we need sighand->threadgroup_fork_lock ? I gueess, to protect
> against clone(CLONE_THREAD).
Right - we want to be able to atomically move all the threads in the
thread group into a new cgroup, without leaving any behind if we
happen to race with a clone(CLONE_THREAD).
Putting the lock in the sighand structure seemed like an appropriate
place since it's involved in existing clone() synchronization.
>
> threadgroup_fork_lock() bumps P->sighand->count. If P exec, it will
> notice sighand->count != 1 and switch to another ->sighand.
So maybe we should also down_read(threadgroup_fork_lock) in the exec
path? That would prevent a child thread from execing and taking over
the group leadership, so it would remain safe to iterate over the
group leader's thread list.
Paul
next prev parent reply other threads:[~2009-08-22 13:28 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-20 21:14 + cgroups-add-functionality-to-read-write-lock-clone_thread-forking-per-threadgroup.patch added to -mm tree akpm
2009-08-21 10:26 ` + cgroups-add-functionality-to-read-write-lock-clone_thread-forking-pe r-threadgroup.patch " Oleg Nesterov
2009-08-21 10:45 ` Oleg Nesterov
2009-08-21 23:37 ` Paul Menage
2009-08-22 13:09 ` Oleg Nesterov
2009-08-22 13:28 ` Paul Menage [this message]
[not found] ` <20090822130952.GA4240-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-01-03 19:06 ` Ben Blum
2010-01-03 19:06 ` Ben Blum
[not found] ` <20100103190613.GA13423-OM76b2Iv3yLQjUSlxSEPGw@public.gmane.org>
2010-01-03 19:07 ` [RFC] [PATCH 1/2] cgroups: read-write lock CLONE_THREAD forking per threadgroup Ben Blum
2010-01-03 19:07 ` Ben Blum
2010-01-05 18:53 ` Oleg Nesterov
[not found] ` <20100105185330.GA17545-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-01-17 20:48 ` Ben Blum
2010-01-17 20:48 ` Ben Blum
2010-03-22 10:22 ` Oleg Nesterov
2010-03-22 23:57 ` Paul Menage
[not found] ` <20100322102247.GA8363-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-03-22 23:57 ` Paul Menage
[not found] ` <20100117204833.GA29596-DC+BO+AtSRVCM1neWV3AGuCmf2DRS9x2@public.gmane.org>
2010-03-22 10:22 ` Oleg Nesterov
[not found] ` <20100103190752.GB13423-OM76b2Iv3yLQjUSlxSEPGw@public.gmane.org>
2010-01-05 18:53 ` Oleg Nesterov
2010-01-03 19:09 ` [RFC] [PATCH 2/2] cgroups: make procs file writable Ben Blum
2010-01-03 19:09 ` Ben Blum
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=6599ad830908220628o7dc99cf1i5908d3e95deb31e5@mail.gmail.com \
--to=menage@google.com \
--cc=akpm@linux-foundation.org \
--cc=bblum@google.com \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=matthltc@us.ibm.com \
--cc=oleg@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.