aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-09-14 14:02:34 -0400
committerIngo Molnar <mingo@elte.hu>2009-09-15 10:51:31 -0400
commita7558e01056f5191ff2ecff53b075dcb9e484188 (patch)
tree1364bbf9273ce353f4f3146aebe567f79b7c8cad /kernel
parent7d47872146398dbede13223299fe1cb368ebc781 (diff)
sched: Add WF_FORK
Avoid the cache buddies from biasing the time distribution away from fork()ers. Normally the next buddy will be the preferred scheduling target, but this makes fork()s prefer to run the new child, whereas we prefer to run the parent, since that will generate more work. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched.c2
-rw-r--r--kernel/sched_fair.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 4da335cec8ee..0d4c4fea3317 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2602,7 +2602,7 @@ void wake_up_new_task(struct task_struct *p, unsigned long clone_flags)
2602 inc_nr_running(rq); 2602 inc_nr_running(rq);
2603 } 2603 }
2604 trace_sched_wakeup_new(rq, p, 1); 2604 trace_sched_wakeup_new(rq, p, 1);
2605 check_preempt_curr(rq, p, 0); 2605 check_preempt_curr(rq, p, WF_FORK);
2606#ifdef CONFIG_SMP 2606#ifdef CONFIG_SMP
2607 if (p->sched_class->task_wake_up) 2607 if (p->sched_class->task_wake_up)
2608 p->sched_class->task_wake_up(rq, p); 2608 p->sched_class->task_wake_up(rq, p);
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 007958e3c93a..6766959c7f44 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -1580,7 +1580,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int flags
1580 */ 1580 */
1581 if (sched_feat(LAST_BUDDY) && likely(se->on_rq && curr != rq->idle)) 1581 if (sched_feat(LAST_BUDDY) && likely(se->on_rq && curr != rq->idle))
1582 set_last_buddy(se); 1582 set_last_buddy(se);
1583 if (sched_feat(NEXT_BUDDY)) 1583 if (sched_feat(NEXT_BUDDY) && !(flags & WF_FORK))
1584 set_next_buddy(pse); 1584 set_next_buddy(pse);
1585 1585
1586 /* 1586 /*