Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: tglx@linutronix.de (Thomas Gleixner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] RFC: nomadik: expand timesource to 63 bits
Date: Thu, 11 Nov 2010 11:16:32 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.2.00.1011111054010.2900@localhost6.localdomain6> (raw)
In-Reply-To: <1289466356-16697-1-git-send-email-linus.walleij@stericsson.com>

On Thu, 11 Nov 2010, Linus Walleij wrote:

> After wraparound-problems in sched_clock() we expand the 32bit
> timer in the MTU from 32 to 63 bits so the scheduling and
> timeline is more stable. At current max operating frequency for
> the MTU, 133 MHz, this should be sufficient for rougly 2200
> years.
> 
> Cc: Colin Cross <ccross@google.com>
> Cc: Rabin Vincent <rabin.vincent@stericsson.com>
> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
> ---
> tglx, nico: can you help out on reviewing this?
> 
> The solution in this patch is based on the similar approach
> taken by the Tegra platform in arch/arm/mach-tegra/timer.c.
> 
> Orion on the other hand will only expand the timer to 63
> bits in the sched_clock() function in arch/arm/plat-orion/time.c
> 
> What we need to know is whether it's OK to simply blow up
> clocksource to 63 bits like this. In that case this
> simplification should also apply to Orion, meaning that it
> would base it's sched_clock() on the clocksource, using
> simply clocksource_cyc2ns() cutting down the code
> significantly.
> 
> My main obstacle is that I cannot really determine whether
> clocksource.read() will be called often enough for the
> cnt32_to_63 algorithm.

We talk about 16 seconds here. If we wouldn't read out the 32bit
clocksource at least once in that time we'd run into wrap issues as
well.

There is only one caveat. When nohz is on and you sleep longer than 16
seconds then the limitation we have in place does not work anymore, as
it would say that the long sleep time is less than the 63bit
wraparound time. With 32bit clocksource it limits the sleep correclty
to avoid the clocksource wrap issue.

Aside of that you are trading a bit less source code with extra code
in the clock read() function, which is called pretty frequently.

Thanks,

	tglx

  reply	other threads:[~2010-11-11 10:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-11  9:05 [PATCH] RFC: nomadik: expand timesource to 63 bits Linus Walleij
2010-11-11 10:16 ` Thomas Gleixner [this message]
2010-11-11 10:31   ` Linus Walleij
2010-11-11 11:05     ` Thomas Gleixner
2010-11-11 18:31       ` Nicolas Pitre
2010-11-11 19:00         ` Thomas Gleixner
2010-11-11 19:19           ` Nicolas Pitre
2010-11-11 21:33 ` john stultz
2010-11-12  9:43   ` Linus Walleij
2010-11-12  9:57   ` Uwe Kleine-König
2010-11-12 10:08     ` Linus Walleij
2010-11-12 10:31       ` Thomas Gleixner
2010-11-12 10:37         ` Linus Walleij
2010-11-12 11:08           ` Thomas Gleixner
2010-11-12 19:18           ` Nicolas Pitre
2010-11-12 20:22           ` john stultz
2010-11-12 19:15     ` Nicolas Pitre

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=alpine.LFD.2.00.1011111054010.2900@localhost6.localdomain6 \
    --to=tglx@linutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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