[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1321971686.6855.18.camel@marge.simson.net>
Date: Tue, 22 Nov 2011 15:21:26 +0100
From: Mike Galbraith <mgalbraith@...e.de>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Suresh Siddha <suresh.b.siddha@...el.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...e.hu>, Paul Turner <pjt@...gle.com>
Subject: [patch 3/7] 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@....de>
---
kernel/sched/core.c | 8 +++++++-
kernel/sched/fair.c | 6 ++++++
2 files changed, 13 insertions(+), 1 deletion(-)
Index: linux-3.0-tip/kernel/sched/core.c
===================================================================
--- linux-3.0-tip.orig/kernel/sched/core.c
+++ linux-3.0-tip/kernel/sched/core.c
@@ -4547,7 +4547,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.0-tip/kernel/sched/fair.c
===================================================================
--- linux-3.0-tip.orig/kernel/sched/fair.c
+++ linux-3.0-tip/kernel/sched/fair.c
@@ -3062,6 +3062,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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists