All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mason <mpeg.blue@free.fr>
To: Stefan Agner <stefan@agner.ch>
Cc: Linux ARM <linux-arm-kernel@lists.infradead.org>,
	cpufreq <cpufreq@vger.kernel.org>,
	Linux PM <linux-pm@vger.kernel.org>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Rob Herring <rob.herring@calxeda.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: Delays, clocks, timers, hrtimers, etc
Date: Fri, 06 Feb 2015 18:21:37 -0800	[thread overview]
Message-ID: <54D576B1.4000001@free.fr> (raw)
In-Reply-To: <266c7b1ff2d1a8ba0ae4866f4fb4eca5@agner.ch>

Stefan Agner wrote:

> On 2015-02-06 22:17, Mason wrote:
>
>> Do you also use the ARM local timers in your port?
>> Is there generic code to handle them?
>
> It seems that there has been support for local timers once, but has been
> removed. But I'm not aware of the details:
> https://lkml.org/lkml/2013/2/22/49

The equivalent gmane link would be:
http://thread.gmane.org/gmane.linux.kernel/1445799

The description used to say:

-config LOCAL_TIMERS
-	bool "Use local timer interrupts"
-	depends on SMP
-	default y
-	select HAVE_ARM_TWD if (!ARCH_MSM_SCORPIONMP && !EXYNOS4_MCT)
-	help
-	  Enable support for local timers on SMP platforms, rather then the
-	  legacy IPI broadcast method.  Local timers allows the system
-	  accounting to be spread across the timer interval, preventing a
-	  "thundering herd" at every timer tick.

which seems to have been replaced with HAVE_ARM_TWD

TWD stands for "Timer Watch Dog".
https://www.kernel.org/doc/Documentation/devicetree/bindings/arm/twd.txt

"ARM 11MP, Cortex-A5 and Cortex-A9 are often associated with a per-core
Timer-Watchdog (aka TWD), which provides both a per-cpu local timer
and watchdog.

The TWD is usually attached to a GIC to deliver its two per-processor
interrupts."


config HAVE_ARM_TWD
   bool
   depends on SMP
   select CLKSRC_OF if OF
   help
     This options enables support for the ARM timer and watchdog unit

One problem I see is that HAVE_ARM_TWD depends on SMP...

One of the systems I want to support is UP (single-core Cortex A9).
Does that mean I should use an SMP kernel even for that system?
Or is there a different subsystem for UP systems?

Also, reading arch/arm/kernel/smp_twd.c, I see that frequency changes
due to cpufreq are properly accounted for. (Although I imagine they do
introduce a small error in time-keeping because moving from freq_A to
freq_B is not instantaneous, so the exact time elapsed in-between is
impossible to determine.)

Regards.


WARNING: multiple messages have this Message-ID (diff)
From: mpeg.blue@free.fr (Mason)
To: linux-arm-kernel@lists.infradead.org
Subject: Delays, clocks, timers, hrtimers, etc
Date: Fri, 06 Feb 2015 18:21:37 -0800	[thread overview]
Message-ID: <54D576B1.4000001@free.fr> (raw)
In-Reply-To: <266c7b1ff2d1a8ba0ae4866f4fb4eca5@agner.ch>

Stefan Agner wrote:

> On 2015-02-06 22:17, Mason wrote:
>
>> Do you also use the ARM local timers in your port?
>> Is there generic code to handle them?
>
> It seems that there has been support for local timers once, but has been
> removed. But I'm not aware of the details:
> https://lkml.org/lkml/2013/2/22/49

The equivalent gmane link would be:
http://thread.gmane.org/gmane.linux.kernel/1445799

The description used to say:

-config LOCAL_TIMERS
-	bool "Use local timer interrupts"
-	depends on SMP
-	default y
-	select HAVE_ARM_TWD if (!ARCH_MSM_SCORPIONMP && !EXYNOS4_MCT)
-	help
-	  Enable support for local timers on SMP platforms, rather then the
-	  legacy IPI broadcast method.  Local timers allows the system
-	  accounting to be spread across the timer interval, preventing a
-	  "thundering herd" at every timer tick.

which seems to have been replaced with HAVE_ARM_TWD

TWD stands for "Timer Watch Dog".
https://www.kernel.org/doc/Documentation/devicetree/bindings/arm/twd.txt

"ARM 11MP, Cortex-A5 and Cortex-A9 are often associated with a per-core
Timer-Watchdog (aka TWD), which provides both a per-cpu local timer
and watchdog.

The TWD is usually attached to a GIC to deliver its two per-processor
interrupts."


config HAVE_ARM_TWD
   bool
   depends on SMP
   select CLKSRC_OF if OF
   help
     This options enables support for the ARM timer and watchdog unit

One problem I see is that HAVE_ARM_TWD depends on SMP...

One of the systems I want to support is UP (single-core Cortex A9).
Does that mean I should use an SMP kernel even for that system?
Or is there a different subsystem for UP systems?

Also, reading arch/arm/kernel/smp_twd.c, I see that frequency changes
due to cpufreq are properly accounted for. (Although I imagine they do
introduce a small error in time-keeping because moving from freq_A to
freq_B is not instantaneous, so the exact time elapsed in-between is
impossible to determine.)

Regards.

  reply	other threads:[~2015-02-07  2:21 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-28 13:16 Delays, clocks, timers, hrtimers, etc Mason
2015-01-28 13:16 ` Mason
2015-01-29 13:57 ` Mason
2015-01-29 13:57   ` Mason
2015-02-03 12:09 ` Russell King - ARM Linux
2015-02-03 12:09   ` Russell King - ARM Linux
2015-02-06 18:37   ` Mason
2015-02-06 18:37     ` Mason
2015-02-06 19:14     ` Russell King - ARM Linux
2015-02-06 19:14       ` Russell King - ARM Linux
2015-02-06 21:03       ` Mason
2015-02-06 21:03         ` Mason
2015-02-07 10:42         ` Russell King - ARM Linux
2015-02-07 10:42           ` Russell King - ARM Linux
2015-02-09  7:45       ` Michal Simek
2015-02-09  7:45         ` Michal Simek
2015-02-09 16:10         ` Sören Brinkmann
2015-02-09 16:10           ` Sören Brinkmann
2015-02-09 23:27   ` Mason
2015-02-09 23:27     ` Mason
2015-02-06 20:25 ` Stefan Agner
2015-02-06 20:25   ` Stefan Agner
2015-02-06 21:17   ` Mason
2015-02-06 21:17     ` Mason
2015-02-06 21:31     ` Stefan Agner
2015-02-06 21:31       ` Stefan Agner
2015-02-07  2:21       ` Mason [this message]
2015-02-07  2:21         ` Mason
2015-02-07  9:51         ` Russell King - ARM Linux
2015-02-07  9:51           ` Russell King - ARM Linux
2015-02-09 19:01         ` Stephen Boyd
2015-02-09 19:01           ` Stephen Boyd
2015-02-09 22:31           ` Mason
2015-02-09 22:31             ` Mason
2015-02-09 23:17             ` Stephen Boyd
2015-02-09 23:17               ` Stephen Boyd
2015-02-09 23:50               ` Mason
2015-02-09 23:50                 ` Mason
2015-02-11 17:43                 ` Mason
2015-02-11 17:43                   ` Mason
2015-02-11 18:45                   ` Stephen Boyd
2015-02-11 18:45                     ` Stephen Boyd
2015-02-11 21:58                     ` Mason
2015-02-11 21:58                       ` Mason
2015-02-11 23:26                       ` Stephen Boyd
2015-02-11 23:26                         ` Stephen Boyd

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=54D576B1.4000001@free.fr \
    --to=mpeg.blue@free.fr \
    --cc=cpufreq@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=rob.herring@calxeda.com \
    --cc=sboyd@codeaurora.org \
    --cc=stefan@agner.ch \
    --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.