From: Oleg Nesterov <oleg@redhat.com>
To: Zefan Li <lizefan@huawei.com>
Cc: Aleksa Sarai <cyphar@cyphar.com>,
Johannes Weiner <hannes@cmpxchg.org>, Tejun Heo <tj@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] cgroup: fix race between cgroup_post_fork() and cgroup_migrate()
Date: Mon, 30 Nov 2015 16:16:47 +0100 [thread overview]
Message-ID: <20151130151630.GA28046@redhat.com> (raw)
In-Reply-To: <56591AED.7050808@huawei.com>
On 11/28, Zefan Li wrote:
>
> On 2015/11/28 2:57, Oleg Nesterov wrote:
>> On 11/26, Oleg Nesterov wrote:
>>>
>>> OK. I do not know what exactly do you mean, perhaps if you fix this problem
>>> the race between fork and attach goes away and in this case the fix I sent
>>> is not needed?
>>
>> Otherwise please consider this series.
>>
>> Slightly tested, seems to work; please review.
>>
>
> Allowing tasks migrating between cgroups while forking is problematic. I'm more
> than glad to see those changes.
Yes, I think this way we can probably do other cleanups/fixes in the generic code
too.
For example, cgroup_enable_task_cg_lists() looks racy, spin_lock_irq(siglock)
can't ensure we can't miss PF_EXITING, exit_signals() doesn't take this lock
in the single-threaded case. We can change it to use cgroup_threadgroup_rwsem
and avoid tasklist_lock afaics.
And I forgot to mention, if we apply this series, we need to rename
threadgroup_change_begin/end and remove the "task_struct *tsk" argument, plus
provide the helpers for write_lock/unlock. Then we can remove
uprobe_start_dup_mmap() and change register_for_each_vma() to use the same
lock.
But I failed to invent the good names for the new helpers ;)
> Acked-by: Zefan Li <lizefan@huawei.com>
Thanks!
Oleg.
next prev parent reply other threads:[~2015-11-30 15:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-27 18:57 [PATCH 0/3] cgroup: fix race between cgroup_post_fork() and cgroup_migrate() Oleg Nesterov
2015-11-27 18:57 ` [PATCH 1/3] cgroup: pids: " Oleg Nesterov
2015-11-27 18:57 ` [PATCH 2/3] cgroup: pids: kill pids_fork(), simplify pids_can_fork() and pids_cancel_fork() Oleg Nesterov
2015-11-27 18:57 ` [PATCH 3/3] cgroup: kill cgrp_ss_priv[CGROUP_CANFORK_COUNT] and friends Oleg Nesterov
2015-12-03 15:18 ` Tejun Heo
2015-11-28 3:09 ` [PATCH 0/3] cgroup: fix race between cgroup_post_fork() and cgroup_migrate() Zefan Li
2015-11-30 15:16 ` Oleg Nesterov [this message]
2015-11-30 14:50 ` Tejun Heo
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=20151130151630.GA28046@redhat.com \
--to=oleg@redhat.com \
--cc=cyphar@cyphar.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=tj@kernel.org \
/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.