mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] cpuset fork locking fix
@ 2005-11-26  4:51 Paul Jackson
  0 siblings, 0 replies; only message in thread
From: Paul Jackson @ 2005-11-26  4:51 UTC (permalink / raw)
  To: akpm, linux-kernel
  Cc: Simon Derr, guillaume.thouvenin, Paul Jackson, matthltc

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-11-26  4:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-26  4:51 [PATCH] cpuset fork locking fix Paul Jackson

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®