]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
sched: virtual time buddy preemption
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Fri, 24 Oct 2008 09:06:16 +0000 (11:06 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 24 Oct 2008 10:51:03 +0000 (12:51 +0200)
Since we moved wakeup preemption back to virtual time, it makes sense to move
the buddy stuff back as well. The purpose of the buddy scheduling is to allow
a quickly scheduling pair of tasks to run away from the group as far as a
regular busy task would be allowed under wakeup preemption.

This has the advantage that the pair can ping-pong for a while, enjoying
cache-hotness. Without buddy scheduling other tasks would interleave destroying
the cache.

Also, it saves a word in cfs_rq.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched.c
kernel/sched_fair.c

index 12bc367d92413705e044539af6489c311a4e9413..e8819bc6f462c18761c11861b4808fd28223b431 100644 (file)
@@ -386,7 +386,6 @@ struct cfs_rq {
 
        u64 exec_clock;
        u64 min_vruntime;
-       u64 pair_start;
 
        struct rb_root tasks_timeline;
        struct rb_node *rb_leftmost;
index 7af17e04a6db86cc6b753e0d5db68b13e4acc240..ce514afd78ff7998338b6661ae22475e808fa3fa 100644 (file)
@@ -791,16 +791,14 @@ set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
        se->prev_sum_exec_runtime = se->sum_exec_runtime;
 }
 
+static int
+wakeup_preempt_entity(struct sched_entity *curr, struct sched_entity *se);
+
 static struct sched_entity *
 pick_next(struct cfs_rq *cfs_rq, struct sched_entity *se)
 {
-       struct rq *rq = rq_of(cfs_rq);
-       u64 pair_slice = rq->clock - cfs_rq->pair_start;
-
-       if (!cfs_rq->next || pair_slice > sysctl_sched_min_granularity) {
-               cfs_rq->pair_start = rq->clock;
+       if (!cfs_rq->next || wakeup_preempt_entity(cfs_rq->next, se) == 1)
                return se;
-       }
 
        return cfs_rq->next;
 }