From: tip-bot for Paul Turner <pjt@google.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
a.p.zijlstra@chello.nl, pjt@google.com, tglx@linutronix.de,
mingo@elte.hu
Subject: [tip:sched/core] sched: update correct entity's runtime in check_preempt_wakeup()
Date: Thu, 21 Jul 2011 18:27:57 GMT [thread overview]
Message-ID: <tip-9bbd7374361d9bfc75108c3ad1c1b6db28b1be59@git.kernel.org> (raw)
In-Reply-To: <CAPM31R+2Ke2urUZKao5W92_LupdR4AYEv-EZWiJ3tG=tEes2cw@mail.gmail.com>
Commit-ID: 9bbd7374361d9bfc75108c3ad1c1b6db28b1be59
Gitweb: http://git.kernel.org/tip/9bbd7374361d9bfc75108c3ad1c1b6db28b1be59
Author: Paul Turner <pjt@google.com>
AuthorDate: Tue, 5 Jul 2011 19:07:21 -0700
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 21 Jul 2011 18:01:43 +0200
sched: update correct entity's runtime in check_preempt_wakeup()
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>
---
kernel/sched_fair.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index e7d67a9..f88720b 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -1919,8 +1919,8 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
if (!sched_feat(WAKEUP_PREEMPT))
return;
- update_curr(cfs_rq);
find_matching_se(&se, &pse);
+ update_curr(cfs_rq_of(se));
BUG_ON(!pse);
if (wakeup_preempt_entity(se, pse) == 1) {
/*
next prev parent reply other threads:[~2011-07-21 18:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20110702005222.262883892@google.com>
2011-07-02 0:52 ` [patch 1/1] sched: update_curr versus correct cfs_rq in check_preempt_wakeup Paul Turner
2011-07-02 9:08 ` Ingo Molnar
2011-07-02 9:57 ` Peter Zijlstra
2011-07-02 10:27 ` Ingo Molnar
2011-07-06 2:07 ` Paul Turner
2011-07-21 18:27 ` tip-bot for Paul Turner [this message]
2011-07-06 1:54 ` Paul Turner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-9bbd7374361d9bfc75108c3ad1c1b6db28b1be59@git.kernel.org \
--to=pjt@google.com \
--cc=a.p.zijlstra@chello.nl \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome