Index: linux-3.0.0-bfs/kernel/sched_bfs.c =================================================================== --- linux-3.0.0-bfs.orig/kernel/sched_bfs.c 2011-09-26 19:42:38.076859947 +1000 +++ linux-3.0.0-bfs/kernel/sched_bfs.c 2011-09-28 12:15:42.927918165 +1000 @@ -1098,6 +1098,11 @@ static inline void unstick_task(struct r rq->sticky_task = NULL; clear_sticky(p); } + +static inline struct task_struct *sticky_task(struct rq *rq) +{ + return rq->sticky_task; +} #else static inline void clear_sticky(struct task_struct *p) { @@ -1116,6 +1121,11 @@ swap_sticky(struct rq *rq, int cpu, stru static inline void unstick_task(struct rq *rq, struct task_struct *p) { } + +static inline struct task_struct *sticky_task(struct rq *rq) +{ + return NULL; +} #endif /* @@ -2923,7 +2933,7 @@ static inline void check_deadline(struct static inline struct task_struct *earliest_deadline_task(struct rq *rq, struct task_struct *idle) { - struct task_struct *edt = idle, *rqs = rq->sticky_task; + struct task_struct *edt = idle, *rqs = sticky_task(rq); skiplist_node *node = grq.node; int cpu = cpu_of(rq); @@ -2950,10 +2960,12 @@ task_struct *earliest_deadline_task(stru * than the task returned by the skiplist since the sticky * task will have its deadline offset when being inserted */ if (rqs != edt && rqs->prio == edt->prio && task_queued(rqs) && - rqs->deadline - longest_deadline_diff() < edt->deadline) + rqs->deadline < edt->deadline) edt = rqs; } - if (edt != idle) + + /* This will pick up when edt == idle and idle is queued for suspend */ + if (task_queued(edt)) take_task(rq, edt); return edt; } @@ -5033,8 +5045,6 @@ void sched_idle_next(struct rq *rq, int /* cpu has to be offline */ BUG_ON(cpu_online(this_cpu)); - break_sole_affinity(this_cpu, idle); - __setscheduler(idle, rq, SCHED_FIFO, STOP_PRIO); activate_idle_task(idle); @@ -5319,6 +5329,7 @@ migration_call(struct notifier_block *nf BUG_ON(!cpumask_test_cpu(cpu, rq->rd->span)); set_rq_offline(rq); } + break_sole_affinity(cpu, idle); grq.noc = num_online_cpus(); grq_unlock_irqrestore(&flags); break; Index: linux-3.0.0-bfs/include/linux/sched.h =================================================================== --- linux-3.0.0-bfs.orig/include/linux/sched.h 2011-09-28 12:34:20.529917994 +1000 +++ linux-3.0.0-bfs/include/linux/sched.h 2011-09-28 12:34:32.450917994 +1000 @@ -1612,7 +1612,7 @@ static inline void tsk_cpus_current(stru static inline void print_scheduler_version(void) { - printk(KERN_INFO"BFS CPU scheduler v0.410 by Con Kolivas.\n"); + printk(KERN_INFO"BFS CPU scheduler v0.411 by Con Kolivas.\n"); } static inline bool iso_task(struct task_struct *p)