[PATCH] cpuset fork locking fix
From: Paul Jackson
Date: Fri Nov 25 2005 - 23:52:05 EST
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@xxxxxxx>
---
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@xxxxxxx> 1.650.933.1373
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/