All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: "Raphael S.Carvalho" <raphael.scarv@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] kernel/fork.c: Simplifying a snippet of code.
Date: Wed, 20 Feb 2013 12:31:19 -0800	[thread overview]
Message-ID: <87hal6iv6w.fsf@xmission.com> (raw)
In-Reply-To: <1361390975-8831-1-git-send-email-raphael.scarv@gmail.com> (Raphael S. Carvalho's message of "Wed, 20 Feb 2013 17:09:35 -0300")

"Raphael S.Carvalho" <raphael.scarv@gmail.com> writes:

> Just sending this patch in order to simplify the code.
> However, I'm not sure if the code was written in that way due to
> specific reasons.

That doesn't look any simpler to me, and I expect you have now biased
the branch in the wrong direction.

The CLONE_THREAD is not the common case.

Eric

> Signed-off-by: Raphael S.Carvalho <raphael.scarv@gmail.com>
> ---
>  kernel/fork.c |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/fork.c b/kernel/fork.c
> index c535f33..237204d 100644
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -1341,9 +1341,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
>  	}
>  
>  	p->pid = pid_nr(pid);
> -	p->tgid = p->pid;
> -	if (clone_flags & CLONE_THREAD)
> -		p->tgid = current->tgid;
> +	p->tgid = (clone_flags & CLONE_THREAD) ? current->tgid : p->pid;
>  
>  	p->set_child_tid = (clone_flags & CLONE_CHILD_SETTID) ? child_tidptr : NULL;
>  	/*

      reply	other threads:[~2013-02-20 20:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-20 20:09 [PATCH 1/1] kernel/fork.c: Simplifying a snippet of code Raphael S.Carvalho
2013-02-20 20:31 ` Eric W. Biederman [this message]

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=87hal6iv6w.fsf@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=raphael.scarv@gmail.com \
    --cc=srikar@linux.vnet.ibm.com \
    --cc=viro@zeniv.linux.org.uk \
    /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.