Skip to content

Commit

Permalink
[PATCH] cpuset fork locking fix
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Paul Jackson authored and Linus Torvalds committed Nov 28, 2005
1 parent 3148890 commit 8c4b8ad
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -1124,8 +1124,6 @@ static task_t *copy_process(unsigned long clone_flags,
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)) {
Expand All @@ -1142,6 +1140,7 @@ static task_t *copy_process(unsigned long clone_flags,
total_forks++;
write_unlock_irq(&tasklist_lock);
proc_fork_connector(p);
cpuset_fork(p);
retval = 0;

fork_out:
Expand Down

0 comments on commit 8c4b8ad

Please sign in to comment.