Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 245590
b: refs/heads/master
c: bd8e7dd
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Apr 14, 2011
1 parent 08f4970 commit 8ae8e60
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 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: 317f394160e9beb97d19a84c39b7e5eb3d7815a8
refs/heads/master: bd8e7dded88a3e1c085c333f19ff31387616f71a
17 changes: 1 addition & 16 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -2198,21 +2198,6 @@ struct migration_arg {

static int migration_cpu_stop(void *data);

/*
* The task's runqueue lock must be held.
* Returns true if you have to wait for migration thread.
*/
static bool need_migrate_task(struct task_struct *p)
{
/*
* If the task is not on a runqueue (and not running), then
* the next wake-up will properly place the task.
*/
bool running = p->on_rq || p->on_cpu;
smp_rmb(); /* finish_lock_switch() */
return running;
}

/*
* wait_task_inactive - wait for a thread to unschedule.
*
Expand Down Expand Up @@ -5985,7 +5970,7 @@ int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask)
goto out;

dest_cpu = cpumask_any_and(cpu_active_mask, new_mask);
if (need_migrate_task(p)) {
if (p->on_rq) {
struct migration_arg arg = { p, dest_cpu };
/* Need help from migration thread: drop lock and wait. */
task_rq_unlock(rq, p, &flags);
Expand Down

0 comments on commit 8ae8e60

Please sign in to comment.