public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pawel Moll <pawel.moll@arm.com>
To: Richard Cochran <richardcochran@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mel Gorman <mgorman@suse.de>,
	Andy Lutomirski <luto@amacapital.net>,
	John Stultz <john.stultz@linaro.org>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Baruch Siach <baruch@tkos.co.il>,
	Thomas Gleixner <tglx@linutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] sched_clock: Track monotonic raw clock
Date: Tue, 22 Jul 2014 17:17:29 +0100	[thread overview]
Message-ID: <1406045849.25343.72.camel@hornet> (raw)
In-Reply-To: <20140719050233.GA4408@netboy>

On Sat, 2014-07-19 at 06:02 +0100, Richard Cochran wrote:
> On Fri, Jul 18, 2014 at 06:43:39PM +0100, Pawel Moll wrote:
> > 
> > This code definitely needs more work and testing (I'm not 100%
> > sure if the Kp and Ki I've picked for the proportional and
> > integral terms are universal),
> 
> I wouldn't bet on it.

Yeah, I should have said: I'm 100% sure they are not universal.

> > but for now wanted to see
> > if this approach makes any sense whatsoever.
> 
> You are reading sched_clock and mono-raw together every so
> often. Really stupid question: Why not just place that information
> into the trace buffer and let user space do the clock correction?

That approach has been also discussed, last time in the mentioned
thread:

http://thread.gmane.org/gmane.linux.kernel/1611683/focus=1612554
http://thread.gmane.org/gmane.linux.kernel/1611683/focus=1612554

With both Ingo and John showing preference towards the clock alignment,
so that's where I looked this time (I've already done custom perf
ioctls, posix clocks... don't really know how many different ways I've
tried).

> ...
> 
> > +		/* Tune the cyc_to_ns formula */
> > +		mult_adj = sign * (error >> 2) + (cd.error_int >> 2);
> 
> So Kp = Ki = 0.25? And did you say that the sample rate is 10/second?
> 
> I guess that, while this works well on your machine, it might not
> always do so, depending on the mono-raw clock. Probably Kp/i need to
> be tunable to a particular system. Even better would be to leave this
> out of the kernel altogether.

My hope is that, given that time correlation is pretty "static" process
(the clock skew should be reasonable, otherwise the time source are
plainly rubbish), there will be a way of implementing this in a
self-tuning way. I may be proven wrong, but it seems like a noble thing
to try.

I fully agree that there is no place for manual PI regulator tuning in
the kernel.

Pawel


  reply	other threads:[~2014-07-22 16:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-18 17:43 [RFC] sched_clock: Track monotonic raw clock Pawel Moll
2014-07-18 17:51 ` John Stultz
2014-07-18 19:06   ` Peter Zijlstra
2014-07-22 16:17   ` Pawel Moll
2014-07-18 19:13 ` Peter Zijlstra
2014-07-18 19:25   ` John Stultz
2014-07-18 19:34     ` Peter Zijlstra
2014-07-18 19:46       ` John Stultz
2014-07-18 20:22         ` Peter Zijlstra
2014-07-18 22:41           ` Peter Zijlstra
2014-07-22 16:17             ` Pawel Moll
2014-07-22 16:29               ` Peter Zijlstra
2014-07-22 16:17       ` Pawel Moll
2014-07-19  5:02 ` Richard Cochran
2014-07-22 16:17   ` Pawel Moll [this message]
2014-07-22 16:34     ` Peter Zijlstra
2014-07-22 16:48       ` Pawel Moll
2014-07-22 19:39     ` Richard Cochran
2014-09-12 11:45       ` Pawel Moll

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=1406045849.25343.72.camel@hornet \
    --to=pawel.moll@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=baruch@tkos.co.il \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=richardcochran@gmail.com \
    --cc=rostedt@goodmis.org \
    --cc=sboyd@codeaurora.org \
    --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