Messages in this thread Patch in this message | | | Subject | [patch 6/6] sched: set skip_clock_update in yield_task_fair() | From | Mike Galbraith <> | Date | Fri, 18 Nov 2011 16:23:26 +0100 |
| |
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>
--- kernel/sched.c | 8 +++++++- kernel/sched_fair.c | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-)
Index: linux-3.2.git/kernel/sched.c =================================================================== --- linux-3.2.git.orig/kernel/sched.c +++ linux-3.2.git/kernel/sched.c @@ -5838,7 +5838,13 @@ again: */ if (preempt && rq != p_rq) resched_task(p_rq->curr); - } + } else + /* + * We might have set it in task_yield_fair(), but are + * not going to schedule(), so don't want to skip + * the next update. + */ + rq->skip_clock_update = 0; out: double_rq_unlock(rq, p_rq); Index: linux-3.2.git/kernel/sched_fair.c =================================================================== --- linux-3.2.git.orig/kernel/sched_fair.c +++ linux-3.2.git/kernel/sched_fair.c @@ -2688,6 +2688,12 @@ static void yield_task_fair(struct rq *r * Update run-time statistics of the 'current'. */ update_curr(cfs_rq); + /* + * Tell update_rq_clock() that we've just updated, + * so we don't do microscopic update in schedule() + * and double the fastpath cost. + */ + rq->skip_clock_update = 1; } set_skip_buddy(se);
| |