diff options
author | Mike Galbraith <mgalbraith@suse.de> | 2011-11-22 09:21:26 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-12-06 03:06:24 -0500 |
commit | 916671c08b7808aebec87cc56c85788e665b3c6b (patch) | |
tree | b3cd42d8fc5ba64f3ee0bff332278758c656141c /kernel/sched | |
parent | 76854c7e8f3f4172fef091e78d88b3b751463ac6 (diff) |
sched: Set skip_clock_update in yield_task_fair()
This is another case where we are on our way to schedule(),
so can save a useless clock update and resulting microscopic
vruntime update.
Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1321971686.6855.18.camel@marge.simson.net
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/core.c | 7 | ||||
-rw-r--r-- | kernel/sched/fair.c | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index ca8fd44145ac..db313c33af29 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -4547,6 +4547,13 @@ again: | |||
4547 | */ | 4547 | */ |
4548 | if (preempt && rq != p_rq) | 4548 | if (preempt && rq != p_rq) |
4549 | resched_task(p_rq->curr); | 4549 | resched_task(p_rq->curr); |
4550 | } else { | ||
4551 | /* | ||
4552 | * We might have set it in task_yield_fair(), but are | ||
4553 | * not going to schedule(), so don't want to skip | ||
4554 | * the next update. | ||
4555 | */ | ||
4556 | rq->skip_clock_update = 0; | ||
4550 | } | 4557 | } |
4551 | 4558 | ||
4552 | out: | 4559 | out: |
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8e534a05e3ed..81ccb811afb4 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c | |||
@@ -3075,6 +3075,12 @@ static void yield_task_fair(struct rq *rq) | |||
3075 | * Update run-time statistics of the 'current'. | 3075 | * Update run-time statistics of the 'current'. |
3076 | */ | 3076 | */ |
3077 | update_curr(cfs_rq); | 3077 | update_curr(cfs_rq); |
3078 | /* | ||
3079 | * Tell update_rq_clock() that we've just updated, | ||
3080 | * so we don't do microscopic update in schedule() | ||
3081 | * and double the fastpath cost. | ||
3082 | */ | ||
3083 | rq->skip_clock_update = 1; | ||
3078 | } | 3084 | } |
3079 | 3085 | ||
3080 | set_skip_buddy(se); | 3086 | set_skip_buddy(se); |