Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 76135
b: refs/heads/master
c: 318e089
h: refs/heads/master
i:
  76133: 5e467c3
  76131: ab3c308
  76127: 5c3c272
v: v3
  • Loading branch information
Gregory Haskins authored and Ingo Molnar committed Jan 25, 2008
1 parent 95d3a00 commit 998e08f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2de0b4639f4b1b6bfe31f795e5855f041f177170
refs/heads/master: 318e0893ce3f524ca045f9fd9dfd567c0a6f9446
19 changes: 19 additions & 0 deletions trunk/kernel/sched_rt.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,27 @@ yield_task_rt(struct rq *rq)
}

#ifdef CONFIG_SMP
static int find_lowest_rq(struct task_struct *task);

static int select_task_rq_rt(struct task_struct *p, int sync)
{
struct rq *rq = task_rq(p);

/*
* If the task will not preempt the RQ, try to find a better RQ
* before we even activate the task
*/
if ((p->prio >= rq->rt.highest_prio)
&& (p->nr_cpus_allowed > 1)) {
int cpu = find_lowest_rq(p);

return (cpu == -1) ? task_cpu(p) : cpu;
}

/*
* Otherwise, just let it ride on the affined RQ and the
* post-schedule router will push the preempted task away
*/
return task_cpu(p);
}
#endif /* CONFIG_SMP */
Expand Down

0 comments on commit 998e08f

Please sign in to comment.