Anyway, complete untested and such..
+void yield_to(struct task_struct *p)...
+{
+ on_rq = p->se.on_rq;
+ if (on_rq)
+ dequeue_task(p_rq, p, 0);
+
+ ret = 0;
+ if (p->sched_class == curr->sched_class&& curr->sched_class->yield_to)
+ curr->sched_class->yield_to(p);
+
+ if (on_rq)
+ enqueue_task(p_rq, p, 0);
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index c886717..8689bcd 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
+static void yield_to_fair(struct task_stuct *p)
+{
+ struct sched_entity *se =¤t->se;
+ struct sched_entity *p_se =&p->se;
+ u64 lag0, p_lag0;
+ s64 lag, p_lag;
+
+ lag0 = avg_vruntime(cfs_rq_of(se));
+ p_lag0 = avg_vruntime(cfs_rq_of(p_se));
+
+ lag = se->vruntime - avg_vruntime(cfs_rq);
+ p_lag = p_se->vruntime - avg_vruntime(p_cfs_rq);
+
+ if (p_lag> lag) { /* if P is owed less service */
+ se->vruntime = lag0 + p_lag;
+ p_se->vruntime = p_lag + lag;
+ }
+
+ /*
+ * XXX try something smarter here
+ */
+ resched_task(p);
+ resched_task(current);
+}