lkml.org 
[lkml]   [2012]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 06/16] sched: SCHED_DEADLINE push and pull logic
From
Date
On Fri, 2012-04-06 at 09:14 +0200, Juri Lelli wrote:

> +static int latest_cpu_find(struct cpumask *span,
> + struct task_struct *task,
> + struct cpumask *later_mask)
> {
> + const struct sched_dl_entity *dl_se = &task->dl;
> + int cpu, found = -1, best = 0;
> + u64 max_dl = 0;
> +
> + for_each_cpu(cpu, span) {
> + struct rq *rq = cpu_rq(cpu);
> + struct dl_rq *dl_rq = &rq->dl;
> +
> + if (cpumask_test_cpu(cpu, &task->cpus_allowed) &&
> + (!dl_rq->dl_nr_running || dl_time_before(dl_se->deadline,
> + dl_rq->earliest_dl.curr))) {
> + if (later_mask)
> + cpumask_set_cpu(cpu, later_mask);
> + if (!best && !dl_rq->dl_nr_running) {

I hate to say this (and I also have yet to look at the patches after
this) but we should really take into account the RT tasks. It would suck
to preempt a normal RT task when a non RT task is running on another
CPU.

-- Steve

> + best = 1;
> + found = cpu;
> + } else if (!best &&
> + dl_time_before(max_dl,
> + dl_rq->earliest_dl.curr)) {
> + max_dl = dl_rq->earliest_dl.curr;
> + found = cpu;
> + }
> + } else if (later_mask)
> + cpumask_clear_cpu(cpu, later_mask);
> + }
> +
> + return found;
> +}




\
 
 \ /
  Last update: 2012-04-11 18:17    [W:0.541 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site