Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 245584
b: refs/heads/master
c: 8f42ced
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Apr 14, 2011
1 parent cdad680 commit 5e73bf7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ab2515c4b98f7bc4fa11cad9fa0f811d63a72a26
refs/heads/master: 8f42ced974df7d5af2de4cf5ea21fe978c7e4478
15 changes: 5 additions & 10 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -3465,27 +3465,22 @@ void sched_exec(void)
{
struct task_struct *p = current;
unsigned long flags;
struct rq *rq;
int dest_cpu;

rq = task_rq_lock(p, &flags);
raw_spin_lock_irqsave(&p->pi_lock, flags);
dest_cpu = p->sched_class->select_task_rq(p, SD_BALANCE_EXEC, 0);
if (dest_cpu == smp_processor_id())
goto unlock;

/*
* select_task_rq() can race against ->cpus_allowed
*/
if (cpumask_test_cpu(dest_cpu, &p->cpus_allowed) &&
likely(cpu_active(dest_cpu)) && need_migrate_task(p)) {
if (likely(cpu_active(dest_cpu))) {
struct migration_arg arg = { p, dest_cpu };

task_rq_unlock(rq, p, &flags);
stop_one_cpu(cpu_of(rq), migration_cpu_stop, &arg);
raw_spin_unlock_irqrestore(&p->pi_lock, flags);
stop_one_cpu(task_cpu(p), migration_cpu_stop, &arg);
return;
}
unlock:
task_rq_unlock(rq, p, &flags);
raw_spin_unlock_irqrestore(&p->pi_lock, flags);
}

#endif
Expand Down

0 comments on commit 5e73bf7

Please sign in to comment.