mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@tv-sign.ru>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	"Paul E. McKenney" <paulmck@us.ibm.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	David Howells <dhowells@redhat.com>,
	Christoph Lameter <clameter@engr.sgi.com>
Subject: [PATCH 3/3] do __unhash_process() under ->siglock
Date: Thu, 23 Feb 2006 01:33:52 +0300	[thread overview]
Message-ID: <43FCE6D0.D4822B9F@tv-sign.ru> (raw)

This patch moves __unhash_process() call from realease_task()
to __exit_signal(), so __detach_pid() is called with ->siglock
held.

This means we don't need tasklist_lock to iterate over thread
group anymore:
 
	copy_process() was already changed to do attach_pid()
	under ->siglock.

	Eric's "pidhash-kill-switch_exec_pids.patch" from -mm
	changed de_thread() so it doesn't touch PIDTYPE_TGID.

NOTE: de_thread() still needs some attention. It still changes
task->pid lockless. Taking ->sighand.siglock here allows to do
more tasklist_lock removals.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- 2.6.16-rc3/kernel/exit.c~3_FIN	2006-02-23 00:54:28.000000000 +0300
+++ 2.6.16-rc3/kernel/exit.c	2006-02-23 01:00:35.000000000 +0300
@@ -110,6 +110,8 @@ static void __exit_signal(struct task_st
 		sig = NULL; /* Marker for below. */
 	}
 
+	__unhash_process(tsk);
+
 	tsk->signal = NULL;
 	cleanup_sighand(tsk);
 	spin_unlock(&sighand->siglock);
@@ -138,8 +140,6 @@ repeat:
 	BUG_ON(!list_empty(&p->ptrace_list) || !list_empty(&p->ptrace_children));
 	__exit_signal(p);
 
-	__unhash_process(p);
-
 	/*
 	 * If we are the last non-leader member of the thread
 	 * group, and the leader is zombie, then notify the

                 reply	other threads:[~2006-02-22 22:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=43FCE6D0.D4822B9F@tv-sign.ru \
    --to=oleg@tv-sign.ru \
    --cc=akpm@osdl.org \
    --cc=clameter@engr.sgi.com \
    --cc=dhowells@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulmck@us.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®