mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Jackson <pj@sgi.com>
To: akpm@osdl.org, linux-kernel@vger.kernel.org
Cc: Simon Derr <Simon.Derr@bull.net>,
	guillaume.thouvenin@bull.net, Paul Jackson <pj@sgi.com>,
	matthltc@us.ibm.com
Subject: [PATCH] cpuset fork locking fix
Date: Fri, 25 Nov 2005 20:51:54 -0800 (PST)	[thread overview]
Message-ID: <20051126045154.28188.49905.sendpatchset@jackhammer.engr.sgi.com> (raw)

Move the cpuset_fork() call below the write_unlock_irq call
in kernel/fork.c copy_process().

Since the cpuset-dual-semaphore-locking-overhaul.patch, the
cpuset_fork() routine acquires task_lock(), so cannot be called
while holding the tasklist_lock for write.

Signed-off-by: Paul Jackson <pj@sgi.com>

---

 kernel/fork.c |    3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)

--- 2.6.15-rc2-mm1.orig/kernel/fork.c	2005-11-25 17:22:23.853126623 -0800
+++ 2.6.15-rc2-mm1/kernel/fork.c	2005-11-25 17:26:44.713419159 -0800
@@ -1131,8 +1131,6 @@ static task_t *copy_process(unsigned lon
 	if (unlikely(p->ptrace & PT_PTRACED))
 		__ptrace_link(p, current->parent);
 
-	cpuset_fork(p);
-
 	attach_pid(p, PIDTYPE_PID, p->pid);
 	attach_pid(p, PIDTYPE_TGID, p->tgid);
 	if (thread_group_leader(p)) {
@@ -1149,6 +1147,7 @@ static task_t *copy_process(unsigned lon
 	nr_threads++;
 	total_forks++;
 	write_unlock_irq(&tasklist_lock);
+	cpuset_fork(p);
 	retval = 0;
 
 fork_out:

-- 
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <pj@sgi.com> 1.650.933.1373

                 reply	other threads:[~2005-11-26  4:52 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=20051126045154.28188.49905.sendpatchset@jackhammer.engr.sgi.com \
    --to=pj@sgi.com \
    --cc=Simon.Derr@bull.net \
    --cc=akpm@osdl.org \
    --cc=guillaume.thouvenin@bull.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthltc@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®