All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Rabin Vincent <rabin@rab.in>
Cc: Paul Mundt <lethal@linux-sh.org>, Ingo Molnar <mingo@elte.hu>,
	Thomas Gleixner <tglx@linutronix.de>,
	Daniel Walker <dwalker@fifo99.com>,
	Linus Walleij <linus.ml.walleij@gmail.com>,
	Andrew Victor <linux@maxim.org.za>,
	Haavard Skinnemoen <hskinnemoen@atmel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	John Stultz <johnstul@linux.vnet.ibm.com>,
	linux-arm-kernel@lists.arm.linux.org.uk,
	linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched: sched_clock() clocksource handling.
Date: Tue, 02 Jun 2009 14:25:41 +0000	[thread overview]
Message-ID: <1243952741.13761.65.camel@twins> (raw)
In-Reply-To: <20090602141737.GA2449@debian>

On Tue, 2009-06-02 at 19:47 +0530, Rabin Vincent wrote:
> On Tue, Jun 02, 2009 at 04:17:18PM +0900, Paul Mundt wrote:
> > sched: sched_clock() clocksource handling.
> > 
> > There are presently a number of issues and limitations with how the
> > clocksource and sched_clock() interaction works today. Configurations
> > tend to be grouped in to one of the following:
> > 
> >     - Platform provides a clocksource unsuitable for sched_clock()
> >       and prefers to use the generic jiffies-backed implementation.
> > 
> >     - Platform provides its own clocksource and sched_clock() that
> >       wraps in to it.
> > 
> >     - Platform uses a generic clocksource (ie, drivers/clocksource/)
> >       combined with the generic jiffies-backed sched_clock().
> > 
> >     - Platform supports multiple sched_clock()-capable clocksources.
> > 
> > This patch adds a new CLOCK_SOURCE_USE_FOR_SCHED_CLOCK flag to address
> > these issues, which can be set for any sched_clock()-capable clocksource.
> > 
> > The generic sched_clock() implementation is likewise switched over to
> > always read from a designated sched_clocksource, which is default
> > initialized to the jiffies clocksource and updated based on the
> > availability of CLOCK_SOURCE_USE_FOR_SCHED_CLOCK sources. As this uses
> > the generic cyc2ns() logic on the clocksource ->read(), most of the
> > platform-specific sched_clock() implementations can subsequently be
> > killed off.
> 
> 80ea3bac3a47bc73efa334d0dd57099d0ff14216 ("ARM: OMAP: sched_clock()
> corrected") seems to have switched omap from cyc2ns() to an open coded
> calculation based on mult_orig because cyc2ns() uses the NTP-adjusted
> mult instead.  Does that apply here or is that change incorrect?

Hmm, that would be a problem, because changing the mult can cause non
monotonic behaviour.

WARNING: multiple messages have this Message-ID (diff)
From: Peter Zijlstra <peterz@infradead.org>
To: Rabin Vincent <rabin@rab.in>
Cc: Paul Mundt <lethal@linux-sh.org>, Ingo Molnar <mingo@elte.hu>,
	Thomas Gleixner <tglx@linutronix.de>,
	Daniel Walker <dwalker@fifo99.com>,
	Linus Walleij <linus.ml.walleij@gmail.com>,
	Andrew Victor <linux@maxim.org.za>,
	Haavard Skinnemoen <hskinnemoen@atmel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	John Stultz <johnstul@linux.vnet.ibm.com>,
	linux-arm-kernel@lists.arm.linux.org.uk,
	linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched: sched_clock() clocksource handling.
Date: Tue, 02 Jun 2009 16:25:41 +0200	[thread overview]
Message-ID: <1243952741.13761.65.camel@twins> (raw)
In-Reply-To: <20090602141737.GA2449@debian>

On Tue, 2009-06-02 at 19:47 +0530, Rabin Vincent wrote:
> On Tue, Jun 02, 2009 at 04:17:18PM +0900, Paul Mundt wrote:
> > sched: sched_clock() clocksource handling.
> > 
> > There are presently a number of issues and limitations with how the
> > clocksource and sched_clock() interaction works today. Configurations
> > tend to be grouped in to one of the following:
> > 
> >     - Platform provides a clocksource unsuitable for sched_clock()
> >       and prefers to use the generic jiffies-backed implementation.
> > 
> >     - Platform provides its own clocksource and sched_clock() that
> >       wraps in to it.
> > 
> >     - Platform uses a generic clocksource (ie, drivers/clocksource/)
> >       combined with the generic jiffies-backed sched_clock().
> > 
> >     - Platform supports multiple sched_clock()-capable clocksources.
> > 
> > This patch adds a new CLOCK_SOURCE_USE_FOR_SCHED_CLOCK flag to address
> > these issues, which can be set for any sched_clock()-capable clocksource.
> > 
> > The generic sched_clock() implementation is likewise switched over to
> > always read from a designated sched_clocksource, which is default
> > initialized to the jiffies clocksource and updated based on the
> > availability of CLOCK_SOURCE_USE_FOR_SCHED_CLOCK sources. As this uses
> > the generic cyc2ns() logic on the clocksource ->read(), most of the
> > platform-specific sched_clock() implementations can subsequently be
> > killed off.
> 
> 80ea3bac3a47bc73efa334d0dd57099d0ff14216 ("ARM: OMAP: sched_clock()
> corrected") seems to have switched omap from cyc2ns() to an open coded
> calculation based on mult_orig because cyc2ns() uses the NTP-adjusted
> mult instead.  Does that apply here or is that change incorrect?

Hmm, that would be a problem, because changing the mult can cause non
monotonic behaviour.

  reply	other threads:[~2009-06-02 14:25 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-02  7:17 [PATCH] sched: sched_clock() clocksource handling Paul Mundt
2009-06-02  7:17 ` Paul Mundt
2009-06-02  7:25 ` Peter Zijlstra
2009-06-02  7:25   ` Peter Zijlstra
2009-06-02  7:35   ` Paul Mundt
2009-06-02  7:35     ` Paul Mundt
2009-06-02  7:41     ` Peter Zijlstra
2009-06-02  7:41       ` Peter Zijlstra
2009-06-02  7:54       ` Paul Mundt
2009-06-02  7:54         ` Paul Mundt
2009-06-02  8:00         ` Peter Zijlstra
2009-06-02  8:00           ` Peter Zijlstra
2009-06-02  8:00           ` Paul Mundt
2009-06-02  8:00             ` Paul Mundt
2009-06-02 11:49         ` Daniel Walker
2009-06-02 11:49           ` Daniel Walker
2009-06-02 20:21           ` Thomas Gleixner
2009-06-02 20:21             ` Thomas Gleixner
2009-06-03  3:36           ` Paul Mundt
2009-06-03  3:36             ` Paul Mundt
2009-06-03 14:58             ` Daniel Walker
2009-06-03 14:58               ` Daniel Walker
2009-06-02 12:26         ` Peter Zijlstra
2009-06-02 12:26           ` Peter Zijlstra
2009-06-02 20:17       ` Thomas Gleixner
2009-06-02 20:17         ` Thomas Gleixner
2009-06-03  3:39         ` Paul Mundt
2009-06-03  3:39           ` Paul Mundt
2009-06-02 14:17 ` Rabin Vincent
2009-06-02 14:29   ` Rabin Vincent
2009-06-02 14:25   ` Peter Zijlstra [this message]
2009-06-02 14:25     ` Peter Zijlstra
2009-06-02 22:24 ` john stultz
2009-06-02 22:24   ` john stultz
2009-06-03  7:03   ` Peter Zijlstra
2009-06-03  7:03     ` Peter Zijlstra

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=1243952741.13761.65.camel@twins \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=dwalker@fifo99.com \
    --cc=hskinnemoen@atmel.com \
    --cc=johnstul@linux.vnet.ibm.com \
    --cc=lethal@linux-sh.org \
    --cc=linus.ml.walleij@gmail.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux@maxim.org.za \
    --cc=mingo@elte.hu \
    --cc=rabin@rab.in \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.