summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-05-09 23:29:51 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-05-09 23:29:51 -0700
commit4197ad870f2d0618da7ca2bea46ec632128c0920 (patch)
tree9b6c799a768cdf2310a62edcc04ac721eda6f26f
parent25de09021d379a49a83f17b80fa638d95c94219a (diff)
[PATCH] sched: Look at another CPU's domain
From: Nick Piggin <nickpiggin@yahoo.com.au> The SMT wake_idle code really wants to look at a non-local CPU's domain in order to check for idle siblings. So change the domain attachment code a little bit so we continue to hold a runqueue's lock while attaching a new domain. This means the locking rules have changed to: you may access your own domain without any lock, you must hold a remote runqueue's lock in order to view its domain.
-rw-r--r--kernel/sched.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 3ba86bfbbbb9..bc4366eae000 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3392,18 +3392,18 @@ static int migration_thread(void * data)
req = list_entry(head->next, migration_req_t, list);
list_del_init(head->next);
- spin_unlock(&rq->lock);
-
if (req->type == REQ_MOVE_TASK) {
+ spin_unlock(&rq->lock);
__migrate_task(req->task, req->dest_cpu);
+ local_irq_enable();
} else if (req->type == REQ_SET_DOMAIN) {
rq->sd = req->sd;
+ spin_unlock_irq(&rq->lock);
} else {
+ spin_unlock_irq(&rq->lock);
WARN_ON(1);
}
- local_irq_enable();
-
complete(&req->done);
}
return 0;