[PORT FROM R4]sched: update correct entity's runtime in check_preempt_wakeup()
authorPaul Turner <pjt@google.com>
Wed, 6 Jul 2011 02:07:21 +0000 (19:07 -0700)
committerbuildbot <buildbot@intel.com>
Wed, 27 Jun 2012 04:21:22 +0000 (21:21 -0700)
commit0c315eeccf8d62f2b9ec80292ae499f06f50832e
tree05d7efec023355293702440f7a2222478cfd5336
parentfbee9e77354b2c447abf938d5578447071423472
[PORT FROM R4]sched: update correct entity's runtime in check_preempt_wakeup()

BZ: 42195

(backport of upstream commit 9bbd7374361d, merged in v3.1-rc1)

While looking at check_preempt_wakeup() I realized that we are
potentially updating the wrong entity in the fair-group scheduling
case. In this case the current task's cfs_rq may not be the same as
the one used for the comparison between the waking task and the
existing task's vruntime.

This potentially results in us using a stale vruntime in the
pre-emption decision, providing a small false preference for the
previous task. The effects of this are bounded since we always
perform a hierarchal update on the tick.

Signed-off-by: Paul Turner <pjt@google.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/CAPM31R+2Ke2urUZKao5W92_LupdR4AYEv-EZWiJ3tG=tEes2cw@mail.gmail.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Change-Id: I32e6c3be9339bbd1f0435365f3b048dcba8c35d1
Orig-Change-Id: I6d728362a5cc654ba0f92ab0043a4011925a4444
Signed-off-by: German Monroy <german.monroy@intel.com>
Reviewed-on: http://android.intel.com:8080/54412
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_fair.c