* [PATCH] MIPS: allow 24Hz timer frequency
@ 2015-09-22 17:16 Paul Burton
2015-09-22 17:16 ` Paul Burton
2015-09-22 18:04 ` Ralf Baechle
0 siblings, 2 replies; 3+ messages in thread
From: Paul Burton @ 2015-09-22 17:16 UTC (permalink / raw)
To: linux-mips; +Cc: Paul Burton, Ralf Baechle, linux-kernel
A boundary exists beyond which the timer frequency becomes high enough
that timer interrupts saturate the system and either cause it to slow to
a crawl or stop functioning entirely. Where that boundary lies depends
upon a number of factors such as the overhead of each interrupt and the
overall speed of the CPU, but correlates strongly with the clock
frequency at which the CPU runs. When running on emulators during
bringup or debug of a CPU that clock frequency is very low, which
results in the boundary at which the timer frequency becomes
unsustainable being very low. The current minimum of 48Hz pushes against
boundary in certain situations in current systems. Allow the kernel to
be configured for a 24Hz timer frequency in order to avoid problems on
such slow running systems.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
---
arch/mips/Kconfig | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index e3aa5b0..79cac90 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -2529,6 +2529,9 @@ choice
help
Allows the configuration of the timer frequency.
+ config HZ_24
+ bool "24 HZ" if SYS_SUPPORTS_24HZ || SYS_SUPPORTS_ARBIT_HZ
+
config HZ_48
bool "48 HZ" if SYS_SUPPORTS_48HZ || SYS_SUPPORTS_ARBIT_HZ
@@ -2552,6 +2555,9 @@ choice
endchoice
+config SYS_SUPPORTS_24HZ
+ bool
+
config SYS_SUPPORTS_48HZ
bool
@@ -2575,13 +2581,18 @@ config SYS_SUPPORTS_1024HZ
config SYS_SUPPORTS_ARBIT_HZ
bool
- default y if !SYS_SUPPORTS_48HZ && !SYS_SUPPORTS_100HZ && \
- !SYS_SUPPORTS_128HZ && !SYS_SUPPORTS_250HZ && \
- !SYS_SUPPORTS_256HZ && !SYS_SUPPORTS_1000HZ && \
+ default y if !SYS_SUPPORTS_24HZ && \
+ !SYS_SUPPORTS_48HZ && \
+ !SYS_SUPPORTS_100HZ && \
+ !SYS_SUPPORTS_128HZ && \
+ !SYS_SUPPORTS_250HZ && \
+ !SYS_SUPPORTS_256HZ && \
+ !SYS_SUPPORTS_1000HZ && \
!SYS_SUPPORTS_1024HZ
config HZ
int
+ default 24 if HZ_24
default 48 if HZ_48
default 100 if HZ_100
default 128 if HZ_128
--
2.5.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] MIPS: allow 24Hz timer frequency
2015-09-22 17:16 [PATCH] MIPS: allow 24Hz timer frequency Paul Burton
@ 2015-09-22 17:16 ` Paul Burton
2015-09-22 18:04 ` Ralf Baechle
1 sibling, 0 replies; 3+ messages in thread
From: Paul Burton @ 2015-09-22 17:16 UTC (permalink / raw)
To: linux-mips; +Cc: Paul Burton, Ralf Baechle, linux-kernel
A boundary exists beyond which the timer frequency becomes high enough
that timer interrupts saturate the system and either cause it to slow to
a crawl or stop functioning entirely. Where that boundary lies depends
upon a number of factors such as the overhead of each interrupt and the
overall speed of the CPU, but correlates strongly with the clock
frequency at which the CPU runs. When running on emulators during
bringup or debug of a CPU that clock frequency is very low, which
results in the boundary at which the timer frequency becomes
unsustainable being very low. The current minimum of 48Hz pushes against
boundary in certain situations in current systems. Allow the kernel to
be configured for a 24Hz timer frequency in order to avoid problems on
such slow running systems.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
---
arch/mips/Kconfig | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index e3aa5b0..79cac90 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -2529,6 +2529,9 @@ choice
help
Allows the configuration of the timer frequency.
+ config HZ_24
+ bool "24 HZ" if SYS_SUPPORTS_24HZ || SYS_SUPPORTS_ARBIT_HZ
+
config HZ_48
bool "48 HZ" if SYS_SUPPORTS_48HZ || SYS_SUPPORTS_ARBIT_HZ
@@ -2552,6 +2555,9 @@ choice
endchoice
+config SYS_SUPPORTS_24HZ
+ bool
+
config SYS_SUPPORTS_48HZ
bool
@@ -2575,13 +2581,18 @@ config SYS_SUPPORTS_1024HZ
config SYS_SUPPORTS_ARBIT_HZ
bool
- default y if !SYS_SUPPORTS_48HZ && !SYS_SUPPORTS_100HZ && \
- !SYS_SUPPORTS_128HZ && !SYS_SUPPORTS_250HZ && \
- !SYS_SUPPORTS_256HZ && !SYS_SUPPORTS_1000HZ && \
+ default y if !SYS_SUPPORTS_24HZ && \
+ !SYS_SUPPORTS_48HZ && \
+ !SYS_SUPPORTS_100HZ && \
+ !SYS_SUPPORTS_128HZ && \
+ !SYS_SUPPORTS_250HZ && \
+ !SYS_SUPPORTS_256HZ && \
+ !SYS_SUPPORTS_1000HZ && \
!SYS_SUPPORTS_1024HZ
config HZ
int
+ default 24 if HZ_24
default 48 if HZ_48
default 100 if HZ_100
default 128 if HZ_128
--
2.5.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] MIPS: allow 24Hz timer frequency
2015-09-22 17:16 [PATCH] MIPS: allow 24Hz timer frequency Paul Burton
2015-09-22 17:16 ` Paul Burton
@ 2015-09-22 18:04 ` Ralf Baechle
1 sibling, 0 replies; 3+ messages in thread
From: Ralf Baechle @ 2015-09-22 18:04 UTC (permalink / raw)
To: Paul Burton; +Cc: linux-mips, linux-kernel, Kevin D. Kissell, Chris Dearman
On Tue, Sep 22, 2015 at 10:16:39AM -0700, Paul Burton wrote:
> A boundary exists beyond which the timer frequency becomes high enough
> that timer interrupts saturate the system and either cause it to slow to
> a crawl or stop functioning entirely. Where that boundary lies depends
> upon a number of factors such as the overhead of each interrupt and the
> overall speed of the CPU, but correlates strongly with the clock
> frequency at which the CPU runs. When running on emulators during
> bringup or debug of a CPU that clock frequency is very low, which
> results in the boundary at which the timer frequency becomes
> unsustainable being very low. The current minimum of 48Hz pushes against
> boundary in certain situations in current systems. Allow the kernel to
> be configured for a 24Hz timer frequency in order to avoid problems on
> such slow running systems.
The current minimum of 48Hz in the MIPS kconfig files predates the
rewrites to use clocksource/clockevent device in 2.6.27 or so. The
value of 48Hz is the lowest value at which the old time code was still
working properly. Afair the change was submitted by Kevin Kissel or
Chris Dearman to improve performance on with emulated CPUs which by that
time were running at like 500kHz (I think it was an IKOS) clock rate.
Presumably below 48Hz the math in the kernel's time code was falling
apart but anyway, afaics the value was derived experimentally.
Ralf
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-09-22 18:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-22 17:16 [PATCH] MIPS: allow 24Hz timer frequency Paul Burton
2015-09-22 17:16 ` Paul Burton
2015-09-22 18:04 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox