public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Oleg Nesterov <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
	torvalds@linux-foundation.org, peterz@infradead.org,
	David.Laight@ACULAB.COM, geert@linux-m68k.org,
	akpm@linux-foundation.org, tj@kernel.org, tglx@linutronix.de,
	oleg@redhat.com
Subject: [tip:sched/core] tasks/fork: Remove unnecessary child->exit_state
Date: Wed, 27 Nov 2013 06:10:10 -0800	[thread overview]
Message-ID: <tip-bb8cbbfee68518796df4050868e5b0f5ad078f9f@git.kernel.org> (raw)
In-Reply-To: <20131113143612.GA10540@redhat.com>

Commit-ID:  bb8cbbfee68518796df4050868e5b0f5ad078f9f
Gitweb:     http://git.kernel.org/tip/bb8cbbfee68518796df4050868e5b0f5ad078f9f
Author:     Oleg Nesterov <oleg@redhat.com>
AuthorDate: Wed, 13 Nov 2013 15:36:12 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 27 Nov 2013 13:50:50 +0100

tasks/fork: Remove unnecessary child->exit_state

A zombie task obviously can't fork(), remove the unnecessary
initialization of child->exit_state. It is zero anyway after
dup_task_struct().

Note: copy_process() is huge and it has a lot of chaotic
initializations, probably it makes sense to move them into the
new helper called by dup_task_struct().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: David Laight <David.Laight@ACULAB.COM>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20131113143612.GA10540@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/fork.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/kernel/fork.c b/kernel/fork.c
index 728d5be..b308082 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1402,13 +1402,11 @@ static struct task_struct *copy_process(unsigned long clone_flags,
 		p->tgid = p->pid;
 	}
 
-	p->pdeath_signal = 0;
-	p->exit_state = 0;
-
 	p->nr_dirtied = 0;
 	p->nr_dirtied_pause = 128 >> (PAGE_SHIFT - 10);
 	p->dirty_paused_when = 0;
 
+	p->pdeath_signal = 0;
 	INIT_LIST_HEAD(&p->thread_group);
 	p->task_works = NULL;
 

  reply	other threads:[~2013-11-27 14:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13 14:35 [PATCH 0/3] state/exit_state cleanups (Was: Remove unused variable ret from sync_thread_master()) Oleg Nesterov
2013-11-13 14:36 ` [PATCH 1/3] proc: cleanup/simplify get_task_state/task_state_array Oleg Nesterov
2013-11-13 14:36 ` [PATCH 2/3] fork: no need to initialize child->exit_state Oleg Nesterov
2013-11-27 14:10   ` tip-bot for Oleg Nesterov [this message]
2013-11-13 14:36 ` [PATCH 3/3] exit_state: kill task_is_dead() Oleg Nesterov
2013-11-27 14:10   ` [tip:sched/core] tasks/exit: Remove unused task_is_dead() method tip-bot for Oleg Nesterov
2013-11-13 14:48 ` [PATCH 0/3] state/exit_state cleanups (Was: Remove unused variable ret from sync_thread_master()) Peter Zijlstra
2013-11-13 14:50   ` Peter Zijlstra
2013-11-13 15:45   ` [PATCH 0/1] sched: Check TASK_DEAD rather than EXIT_DEAD in schedule_debug() Oleg Nesterov
2013-11-13 15:45     ` [PATCH 1/1] " Oleg Nesterov
2013-11-27 14:10       ` [tip:sched/core] " tip-bot for Oleg Nesterov
2013-11-13 15:58     ` [PATCH 0/1] " Peter Zijlstra

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=tip-bb8cbbfee68518796df4050868e5b0f5ad078f9f@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=akpm@linux-foundation.org \
    --cc=geert@linux-m68k.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox