Commit 4197ad87 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[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.
parent 25de0902
...@@ -3392,18 +3392,18 @@ static int migration_thread(void * data) ...@@ -3392,18 +3392,18 @@ static int migration_thread(void * data)
req = list_entry(head->next, migration_req_t, list); req = list_entry(head->next, migration_req_t, list);
list_del_init(head->next); list_del_init(head->next);
spin_unlock(&rq->lock);
if (req->type == REQ_MOVE_TASK) { if (req->type == REQ_MOVE_TASK) {
spin_unlock(&rq->lock);
__migrate_task(req->task, req->dest_cpu); __migrate_task(req->task, req->dest_cpu);
local_irq_enable();
} else if (req->type == REQ_SET_DOMAIN) { } else if (req->type == REQ_SET_DOMAIN) {
rq->sd = req->sd; rq->sd = req->sd;
spin_unlock_irq(&rq->lock);
} else { } else {
spin_unlock_irq(&rq->lock);
WARN_ON(1); WARN_ON(1);
} }
local_irq_enable();
complete(&req->done); complete(&req->done);
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment