]> git.karo-electronics.de Git - karo-tx-linux.git/commit
kernel/fork.c:copy_process(): consolidate the lockless CLONE_THREAD checks
authorOleg Nesterov <oleg@redhat.com>
Wed, 19 Jun 2013 00:08:22 +0000 (10:08 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Jun 2013 07:27:42 +0000 (17:27 +1000)
commit9ba05a253843d270d2920e5e06c9a8adfcd62470
treec0f3a206d4dfe7305f89e5f70dfdf888b441bde4
parent7119f9141c8f015150a23a9c09c8d9fcad8cadad
kernel/fork.c:copy_process(): consolidate the lockless CLONE_THREAD checks

copy_process() does a lot of "chaotic" initializations and checks
CLONE_THREAD twice before it takes tasklist.  In particular it sets
"p->group_leader = p" and then changes it again under tasklist if
!thread_group_leader(p).

This looks a bit confusing, lets create a single "if (CLONE_THREAD)" block
which initializes ->exit_signal, ->group_leader, and ->tgid.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Pavel Emelyanov <xemul@parallels.com>
Cc: Sergey Dyasly <dserrg@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/fork.c