linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Li Zhong <zhong@linux.vnet.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Paul Turner <pjt@google.com>, Mike Galbraith <efault@gmx.de>
Subject: [PATCH 2/5] sched: Update rq clock before setting fair group shares
Date: Fri, 12 Apr 2013 01:50:59 +0200	[thread overview]
Message-ID: <1365724262-20142-3-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1365724262-20142-1-git-send-email-fweisbec@gmail.com>

Because we may update the execution time (sched_group_set_shares()->
	update_cfs_shares()->reweight_entity()->update_curr()) before
reweighting the entity while setting the group shares and this requires
an uptodate version of the runqueue clock.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Li Zhong <zhong@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Paul Turner <pjt@google.com>
Cc: Mike Galbraith <efault@gmx.de>
---
 kernel/sched/fair.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 155783b..c23dde4 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6057,6 +6057,9 @@ int sched_group_set_shares(struct task_group *tg, unsigned long shares)
 		se = tg->se[i];
 		/* Propagate contribution to hierarchy */
 		raw_spin_lock_irqsave(&rq->lock, flags);
+
+		/* Possible calls to update_curr() need rq clock */
+		update_rq_clock(rq);
 		for_each_sched_entity(se)
 			update_cfs_shares(group_cfs_rq(se));
 		raw_spin_unlock_irqrestore(&rq->lock, flags);
-- 
1.7.5.4


  parent reply	other threads:[~2013-04-11 23:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-11 23:50 [RFC GIT PULL] sched; Fix a few missing rq clock updates Frederic Weisbecker
2013-04-11 23:50 ` [PATCH 1/5] sched: Update rq clock before migrating tasks out of dying CPU Frederic Weisbecker
2013-05-28 13:08   ` [tip:sched/core] " tip-bot for Frederic Weisbecker
2013-04-11 23:50 ` Frederic Weisbecker [this message]
2013-05-28 13:09   ` [tip:sched/core] sched: Update rq clock before setting fair group shares tip-bot for Frederic Weisbecker
2013-04-11 23:51 ` [PATCH 3/5] sched: Update rq clock before calling check_preempt_curr() Frederic Weisbecker
2013-05-28 13:10   ` [tip:sched/core] " tip-bot for Frederic Weisbecker
2013-04-11 23:51 ` [PATCH 4/5] sched: Update rq clock earlier in unthrottle_cfs_rq Frederic Weisbecker
2013-05-28 13:11   ` [tip:sched/core] " tip-bot for Frederic Weisbecker
2013-04-11 23:51 ` [PATCH 5/5] sched: Use an accessor to read rq clock Frederic Weisbecker
2013-05-28 13:13   ` [tip:sched/core] sched: Use an accessor to read the " tip-bot for Frederic Weisbecker
2013-05-14 11:57 ` [RFC GIT PULL] sched; Fix a few missing rq clock updates Peter Zijlstra
2013-05-14 12:46   ` Frederic Weisbecker

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=1365724262-20142-3-git-send-email-fweisbec@gmail.com \
    --to=fweisbec@gmail.com \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=zhong@linux.vnet.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).