[PORT FROM R4]sched: Set skip_clock_update in yield_task_fair()
authorMike Galbraith <mgalbraith@suse.de>
Tue, 22 Nov 2011 14:21:26 +0000 (15:21 +0100)
committerbuildbot <buildbot@intel.com>
Wed, 27 Jun 2012 04:21:14 +0000 (21:21 -0700)
BZ: 42195

(backport of upstream commit 916671c08, merged in v3.3-rc1)

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>
Change-Id: I55962c20a65857f52566c1970cb02e27f82845a8
Orig-Change-Id: I9e0b31ea4008cb0ed84b1dd3739c401856fdac4d
Signed-off-by: German Monroy <german.monroy@intel.com>
Reviewed-on: http://android.intel.com:8080/54410
Reviewed-by: Yang, Fei <fei.yang@intel.com>
Tested-by: Ng, Cheon-woei <cheon-woei.ng@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
kernel/sched.c
kernel/sched_fair.c

index d35e6ca..6422d22 100644 (file)
@@ -5663,6 +5663,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:
index 15eca5d..e435b13 100644 (file)
@@ -2014,6 +2014,12 @@ static void yield_task_fair(struct rq *rq)
                 * 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);