lkml.org 
[lkml]   [2012]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[patch] BFS 421: fix try_preempt
From
We have to keep deadline latest, so no update if not checked.

Alternatively we could try preempt in the following way,

rcu_read_lock();
for_each_domain(task_cpu(q), sd) {
for_each_cpu_and(cpu, tsk_cpus_allowed(p),
sched_domain_span(sd)) {
if (!cpu_online(cpu))
continue;
if (can_preempt(p, cpu_rq(cpu)->rq_prio,
cpu_rq(cpu)->rq_deadline)) {
resched_task(cpu_rq(cpu)->curr);
goto out;
}
}
}
out:
rcu_read_unlock();


where the upside is that the LLC is invovled, and the downside is that we are
not sure the preempted task has the highest priority and the latest deadline.

What to do next?


--- a/kernel/sched/bfs.c Wed Jun 6 20:14:36 2012
+++ b/kernel/sched/bfs.c Wed Jun 6 20:16:48 2012
@@ -1452,10 +1452,11 @@ static void try_preempt(struct task_stru
if (rq_prio < highest_prio)
continue;

- if (rq_prio > highest_prio ||
- deadline_after(rq->rq_deadline, latest_deadline)) {
+ if (rq_prio > highest_prio)
+ goto set;
+ if (deadline_after(rq->rq_deadline, latest_deadline)) {
latest_deadline = rq->rq_deadline;
- highest_prio = rq_prio;
+set: highest_prio = rq_prio;
highest_prio_rq = rq;
}
}
--

\
 
 \ /
  Last update: 2012-06-06 16:01    [W:0.108 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site