--- include/linux/sched.h | 2 +- kernel/sched_bfs.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) Index: linux-2.6.34-ck1/include/linux/sched.h =================================================================== --- linux-2.6.34-ck1.orig/include/linux/sched.h 2010-05-19 11:33:30.089236338 +1000 +++ linux-2.6.34-ck1/include/linux/sched.h 2010-05-19 11:34:04.364487841 +1000 @@ -1194,7 +1194,7 @@ struct task_struct { int prio, static_prio, normal_prio; unsigned int rt_priority; #ifdef CONFIG_SCHED_BFS - int time_slice, first_time_slice; + int time_slice, first_time_slice, yielding; unsigned long deadline; struct list_head run_list; u64 last_ran; Index: linux-2.6.34-ck1/kernel/sched_bfs.c =================================================================== --- linux-2.6.34-ck1.orig/kernel/sched_bfs.c 2010-05-19 11:33:30.076235291 +1000 +++ linux-2.6.34-ck1/kernel/sched_bfs.c 2010-05-19 11:43:28.787485325 +1000 @@ -2449,6 +2449,10 @@ retry: } dl = p->deadline + cache_distance(task_rq(p), rq, p); + if (unlikely(p->yielding)) { + dl += longest_deadline_diff(); + p->yielding = 0; + } /* * Look for tasks with old deadlines and pick them in FIFO @@ -3855,8 +3859,8 @@ SYSCALL_DEFINE3(sched_getaffinity, pid_t * sys_sched_yield - yield the current processor to other threads. * * This function yields the current CPU to other tasks. It does this by - * scheduling away the current task. If it still has the earliest deadline - * it will be scheduled again as the next task. + * scheduling away the current task and flagging itself as yielding. Its + * deadline will be temporarily ignored on next reschedule. */ SYSCALL_DEFINE0(sched_yield) { @@ -3867,6 +3871,7 @@ SYSCALL_DEFINE0(sched_yield) rq = task_grq_lock_irq(p); schedstat_inc(rq, yld_count); requeue_task(p); + p->yielding = 1; /* * Since we are going to call schedule() anyway, there's