public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Alessio Igor Bogani <abogani@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Chris Metcalf <cmetcalf@tilera.com>,
	Christoph Lameter <cl@linux.com>,
	Geoff Levand <geoff@infradead.org>,
	Gilad Ben Yossef <gilad@benyossef.com>,
	Hakan Akkan <hakanakkan@gmail.com>,
	Li Zhong <zhong@linux.vnet.ibm.com>,
	Namhyung Kim <namhyung.kim@lge.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Paul Turner <pjt@google.com>, Mike Galbraith <efault@gmx.de>
Subject: Re: [PATCH 2/7] sched: Update rq clock on nohz CPU before setting fair group shares
Date: Tue, 09 Apr 2013 11:26:31 +0200	[thread overview]
Message-ID: <1365499591.30071.3.camel@laptop> (raw)
In-Reply-To: <1365266760-24725-3-git-send-email-fweisbec@gmail.com>

On Sat, 2013-04-06 at 18:45 +0200, Frederic Weisbecker wrote:
> Because we may update the execution time (sched_group_set_shares()->
>         update_cfs_shares()->reweight_entity()->update_curr()) before
> reweighting the entity after updating the group shares and this
> requires
> an uptodate version of the runqueue clock. Let's update it on the
> target
> CPU if it runs tickless because scheduler_tick() is not there to
> maintain
> it.

Same as the last comment, we should never rely on the tick to update
->clock except for the work done by the tick itself.

Therefore you seem to have found another missing clock update.

The problem seems to be that we haven't been able to come up with a
sane debug framework for the ->clock updates. But we should have at
least one (and preferably no more) update_sched_clock() calls per
scheduler entry point.

> ---
>  kernel/sched/fair.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 539760e..6d35f8a 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -6060,6 +6060,11 @@ 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);
> +               /*
> +                * We may call update_curr() which needs an up-to-date
> +                * version of rq clock if the CPU runs tickless.
> +                */
> +               update_nohz_rq_clock(rq);
>                 for_each_sched_entity(se)
>                         update_cfs_shares(group_cfs_rq(se));
>                 raw_spin_unlock_irqrestore(&rq->lock, flags);



  reply	other threads:[~2013-04-09  9:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-06 16:45 [RFC GIT PULL] nohz: Full dynticks rq clock handling Frederic Weisbecker
2013-04-06 16:45 ` [PATCH 1/7] sched: Update rq clock on nohz CPU before migrating tasks Frederic Weisbecker
2013-04-08 11:48   ` Ingo Molnar
2013-04-09  9:13   ` Peter Zijlstra
2013-04-09 13:11     ` Frederic Weisbecker
2013-04-06 16:45 ` [PATCH 2/7] sched: Update rq clock on nohz CPU before setting fair group shares Frederic Weisbecker
2013-04-09  9:26   ` Peter Zijlstra [this message]
2013-04-09 13:21     ` Frederic Weisbecker
2013-04-10  7:05       ` Peter Zijlstra
2013-04-10 10:06         ` Ingo Molnar
2013-04-10 11:02           ` Peter Zijlstra
2013-04-10 11:06             ` Ingo Molnar
2013-04-10 11:47               ` Peter Zijlstra
2013-04-10 11:50                 ` Ingo Molnar
2013-04-06 16:45 ` [PATCH 3/7] sched: Update rq clock on tickless CPUs before calling check_preempt_curr() Frederic Weisbecker
2013-04-09 13:18   ` Peter Zijlstra
2013-04-09 16:53     ` Frederic Weisbecker
2013-04-06 16:45 ` [PATCH 4/7] sched: Update rq clock earlier in unthrottle_cfs_rq Frederic Weisbecker
2013-04-06 16:45 ` [PATCH 5/7] sched: Update rq clock before idle balancing Frederic Weisbecker
2013-04-06 16:45 ` [PATCH 6/7] sched: Use an accessor to read rq clock Frederic Weisbecker
2013-04-06 16:46 ` [PATCH 7/7] sched: Debug nohz " Frederic Weisbecker
2013-04-10 10:26 ` [RFC GIT PULL] nohz: Full dynticks rq clock handling Peter Zijlstra
2013-04-10 10:29   ` Ingo Molnar
2013-04-11 15:11   ` 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=1365499591.30071.3.camel@laptop \
    --to=peterz@infradead.org \
    --cc=abogani@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=cmetcalf@tilera.com \
    --cc=efault@gmx.de \
    --cc=fweisbec@gmail.com \
    --cc=geoff@infradead.org \
    --cc=gilad@benyossef.com \
    --cc=hakanakkan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=paul.gortmaker@windriver.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --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