clocksource: Allow toggling between runtime and persistent clocksource for idle
Subsystems (4)
Tony Lindgren
maintainerPATCH 1/1 clocksource: Allow toggling between runtime and persistent clocksource for idle
Some persistent clocksources can be on a slow external bus. For shorter latencies for RT use, let's allow toggling the clocksource during idle between a faster non-persistent runtime clocksource and a slower persistent clocksource.
---
Anybody got better ideas for something like last_idled_cpu() type check at the end of this patch?
--- include/linuxt-email-lkml-omap/clocksource.h | 2 ++ kernel/time/clocksource.c | 60 +++++++++++++++++++++++++++++++++++++++++++-- kernel/time/timekeeping.c | 13 +++++++++- 3 files changed, 72 insertions(+), 3 deletions(-)
include/linux/clocksource.h +2 -0
@@ -232,6 +232,8 @@ static inline void __clocksource_update_freq_khz(struct clocksource *cs, u32 khzextern int timekeeping_notify (struct clocksource *clock); +extern int clocksource_pm_enter (void ); +extern void clocksource_pm_exit (void );extern cycle_t clocksource_mmio_readl_up (struct clocksource *);extern cycle_t clocksource_mmio_readl_down (struct clocksource *);
kernel/time/clocksource.c +58 -2
96 lines not on this page · raw message
kernel/time/timekeeping.c +12 -1
@@ -1086,7 +1086,18 @@ int timekeeping_notify(struct clocksource *clock)if (tk->tkr_mono.clock == clock)return 0 ; -stop_machine (change_clocksource, clock,NULL ); + +/* +* We may want to toggle between a fast and a persistent +* clocksource from CPUidle on the last active CPU and can't +* use stop_machine at that point. +*/ +if (cpumask_test_cpu (smp_processor_id (), cpu_online_mask) && + !rcu_is_watching ()) +change_clocksource (clock); +else +stop_machine (change_clocksource, clock,NULL ); +tick_clock_notify ();return tk->tkr_mono.clock == clock ?0 :-1 ; }
Signature · 1 line
2.1.4
Quoted 4 lines · Tony Lindgren
Some persistent clocksources can be on a slow external bus. For shorter latencies for RT use, let's allow toggling the clocksource during idle between a faster non-persistent runtime clocksource and a slower persistent clocksource.
I really cannot follow that RT argument here. The whole switchover causes latencies itself and whats worse is, that this breaks timekeeping accuracy because there is no way to switch clocksources atomically without loss.
Quoted 2 lines
--- include/linuxt-email-lkml-omap/clocksource.h | 2 ++
Interesting file name.
include/linux/clocksource.h static inline void __clocksource_update_freq_khz(struct clocksource *cs, u32 khz · line 236
Quoted 3 lines
extern int
timekeeping_notify(struct clocksource *clock);include/linux/clocksource.h +2
-0+extern int clocksource_pm_enter (void ); +extern void clocksource_pm_exit (void );
Unfortunately you are not providing the call site, so I cannot see from which context this is going to be called.
I fear its from the guts of the idle code probably with interrupts disabled etc ...., right?
Quoted 4 lines
kernel/time/clocksource.c +4
-0+/** +* clocksource_pm_enter - change to a persistent clocksource before idle +* +* Changes system to use a persistent clocksource for idle. Intended to
kernel/time/clocksource.c int clocksource_unregister(struct clocksource *cs) · line 824
Quoted 10 lines
kernel/time/clocksource.c +10
-0+* be called from CPUidle from the last active CPU. +*/ +int clocksource_pm_enter (void ) +{ +bool oneshot =tick_oneshot_mode_active (); +struct clocksource *best; + +if (WARN_ONCE (!mutex_trylock (&clocksource_mutex), +"Unable to get clocksource_mutex" )) +return -EINTR ;
This trylock serves which purpose?
Quoted 25 lines
kernel/time/clocksource.c +25
-0+ + best =clocksource_find_best (oneshot, true, false); +if (best) { +if (curr_clocksource != best && + !timekeeping_notify (best)) { + runtime_clocksource = curr_clocksource; + curr_clocksource = best; + } + } +mutex_unlock (&clocksource_mutex); + +return !!best; +} + +/** +* clocksource_pm_exit - change to a runtime clocksrouce after idle +* +* Changes system to use the best clocksource for runtime. Intended to +* be called after waking up from CPUidle on the first active CPU. +*/ +void clocksource_pm_exit (void ) +{ +if (WARN_ONCE (!mutex_trylock (&clocksource_mutex), +"Unable to get clocksource_mutex" )) +return ;
kernel/time/clocksource.c int clocksource_unregister(struct clocksource *cs) · line 859
Quoted 10 lines
kernel/time/clocksource.c +10
-0+ +if (runtime_clocksource) { +if (curr_clocksource != runtime_clocksource && + !timekeeping_notify (runtime_clocksource)) { + curr_clocksource = runtime_clocksource; + runtime_clocksource =NULL ; + } + } +mutex_unlock (&clocksource_mutex); +}
I really cannot see how this is proper serialized.
Quoted 9 lines
#ifdef
CONFIG_SYSFS
/**
*sysfs_show_current_clocksources- sysfs interface for current clocksourcekernel/time/timekeeping.c +0
-0@@ -1086,7 +1086,18 @@ int timekeeping_notify(struct clocksource *clock)
kernel/time/timekeeping.c int timekeeping_notify(struct clocksource *clock) · line 1095
Quoted 10 lines
kernel/time/timekeeping.c +7
-1if (tk->tkr_mono.clock == clock)return 0 ; -stop_machine (change_clocksource, clock,NULL ); + +/* +* We may want to toggle between a fast and a persistent +* clocksource from CPUidle on the last active CPU and can't +* use stop_machine at that point. +*/ + if (cpumask_test_cpu(smp_processor_id(), cpu_online_mask) &&
Can you please explain how this code gets called from an offline cpu?
kernel/time/timekeeping.c int timekeeping_notify(struct clocksource *clock) · line 1096
Quoted 1 line
kernel/time/timekeeping.c +1
-0+ !rcu_is_watching())
So pick some random combination of conditions and define that it is correct, right? How on earth does !rcu_watching() tell that this is the last running cpu.
kernel/time/timekeeping.c int timekeeping_notify(struct clocksource *clock) · line 1099
Quoted 3 lines
kernel/time/timekeeping.c +3
-0+change_clocksource (clock); + else +stop_machine (change_clocksource ,clock ,NULL );
This patch definitely earns a place in my ugly code museum under the category 'Does not explode in my face, so it must be correct'.
Thanks,
tglx
Tony Lindgren
maintainerHi,
Quoted 11 lines · Thomas Gleixner
Quoted 4 lines · Tony Lindgren
Some persistent clocksources can be on a slow external bus. For shorter latencies for RT use, let's allow toggling the clocksource during idle between a faster non-persistent runtime clocksource and a slower persistent clocksource.
I really cannot follow that RT argument here. The whole switchover causes latencies itself and whats worse is, that this breaks timekeeping accuracy because there is no way to switch clocksources atomically without loss.
It would be during deeper idle states.. But yeah the RT use would be better replaced in the description with with "lower runtime timer latency".
The timekeeping accuracy issue certainly needs some thinking, and also the resolution between the clocksources can be different.. In the test case I have the slow timer is always on and of a lower resolution than the ARM global timer being used during runtime.
Got some handy timer test in mind you want me to run to provide data on the accuracy?
Quoted 4 lines
Quoted 2 lines
--- include/linuxt-email-lkml-omap/clocksource.h | 2 ++Interesting file name.
Heh that needs to go back to sed land :)
Quoted 9 lines
Review
Quoted 3 lines
extern int
timekeeping_notify(struct clocksource *clock);(quoted diff) +2
-0+extern int clocksource_pm_enter(void); +extern void clocksource_pm_exit(void);Unfortunately you are not providing the call site, so I cannot see from which context this is going to be called.
I fear its from the guts of the idle code probably with interrupts disabled etc ...., right?
Yes from the last cpu active in cpuidle. Here's the related snippet in my case:
arch/arm/mach-omap2/cpuidle44xx.c +2 -0
@@ -111,6 +111,7 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, (cx->mpu_logic_state ==PWRDM_POWER_OFF );tick_broadcast_enter (); +clocksource_pm_enter ();/* * Call idle CPU PM enter notifier chain so that
@@ -167,6 +168,7 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev,if (dev->cpu ==0 && mpuss_can_lose_context)cpu_cluster_pm_exit (); +clocksource_pm_exit ();tick_broadcast_exit (); fail:
Quoted 8 lines
Quoted 8 lines
(quoted diff) +8
-0+/** + * clocksource_pm_enter - change to a persistent clocksource before idle + * + * Changes system to use a persistent clocksource for idle. Intended to + * be called from CPUidle from the last active CPU. + */ +int clocksource_pm_enter(void) +{
Quoted 8 lines
Review
Quoted 6 lines
(quoted diff) +6
-0+ bool oneshot = tick_oneshot_mode_active(); + struct clocksource *best; + + if (WARN_ONCE(!mutex_trylock(&clocksource_mutex), + "Unable to get clocksource_mutex")) + return -EINTR;This trylock serves which purpose?
Well we don't want to start changing clocksource if something is running like you pointed out.
Quoted 28 lines
Quoted 28 lines
(quoted diff) +28
-0+ best = clocksource_find_best(oneshot, true, false); + if (best) { + if (curr_clocksource != best && + !timekeeping_notify(best)) { + runtime_clocksource = curr_clocksource; + curr_clocksource = best; + } + } + mutex_unlock(&clocksource_mutex); + + return !!best; +} + +/** + * clocksource_pm_exit - change to a runtime clocksrouce after idle + * + * Changes system to use the best clocksource for runtime. Intended to + * be called after waking up from CPUidle on the first active CPU. + */ +void clocksource_pm_exit(void) +{ + if (WARN_ONCE(!mutex_trylock(&clocksource_mutex), + "Unable to get clocksource_mutex")) + return; + + if (runtime_clocksource) { + if (curr_clocksource != runtime_clocksource && + !timekeeping_notify(runtime_clocksource)) {
Quoted 8 lines
Review
Quoted 6 lines
(quoted diff) +6
-0+ curr_clocksource = runtime_clocksource; + runtime_clocksource = NULL; + } + } + mutex_unlock(&clocksource_mutex); +}I really cannot see how this is proper serialized.
We need to allow this only from the last cpu before hitting idle.
Quoted 9 lines
Quoted 9 lines
#ifdef
CONFIG_SYSFS
/**
*sysfs_show_current_clocksources- sysfs interface for current clocksourcekernel/time/timekeeping.c +0
-0@@ -1086,7 +1086,18 @@ int timekeeping_notify(struct clocksource *clock)
Quoted 12 lines
kernel/time/timekeeping.c int timekeeping_notify(struct clocksource *clock) · line 1095
Quoted 10 lines
kernel/time/timekeeping.c +7
-1if (tk->tkr_mono.clock == clock)return 0 ; -stop_machine (change_clocksource, clock,NULL ); + +/* +* We may want to toggle between a fast and a persistent +* clocksource from CPUidle on the last active CPU and can't +* use stop_machine at that point. +*/ + if (cpumask_test_cpu(smp_processor_id(), cpu_online_mask) &&Can you please explain how this code gets called from an offline cpu?
Last cpu getting idled..
Quoted 5 lines
kernel/time/timekeeping.c int timekeeping_notify(struct clocksource *clock) · line 1096
Quoted 1 line
kernel/time/timekeeping.c +1
-0+ !rcu_is_watching())So pick some random combination of conditions and define that it is correct, right? How on earth does !rcu_watching() tell that this is the last running cpu.
We have called rcu_idle_enter() from cpuidle_idle_call(). Do you have some better test in mind when the last cpu is about hit idle?
Quoted 6 lines
kernel/time/timekeeping.c int timekeeping_notify(struct clocksource *clock) · line 1099
Quoted 3 lines
kernel/time/timekeeping.c +3
-0+change_clocksource (clock); + else +stop_machine (change_clocksource ,clock ,NULL );This patch definitely earns a place in my ugly code museum under the category 'Does not explode in my face, so it must be correct'.
Yeah TSC-like issues revisited on other architectures.. I was expecting something like that from you on this one :)
Regards,
Tony
Quoted 9 lines · Tony Lindgren
Quoted 1 line · Thomas Gleixner
On Mon, 6 Jul 2015, Tony Lindgren wrote:
The timekeeping accuracy issue certainly needs some thinking, and also the resolution between the clocksources can be different.. In the test case I have the slow timer is always on and of a lower resolution than the ARM global timer being used during runtime.
Got some handy timer test in mind you want me to run to provide data on the accuracy?
John Stultz might have something.
Quoted 17 lines
Quoted 8 lines
Quoted 8 lines
(quoted diff) +8
-0+/** + * clocksource_pm_enter - change to a persistent clocksource before idle + * + * Changes system to use a persistent clocksource for idle. Intended to + * be called from CPUidle from the last active CPU. + */ +int clocksource_pm_enter(void) +{Quoted 8 lines
Review
Quoted 6 lines
(quoted diff) +6
-0+ bool oneshot = tick_oneshot_mode_active(); + struct clocksource *best; + + if (WARN_ONCE(!mutex_trylock(&clocksource_mutex), + "Unable to get clocksource_mutex")) + return -EINTR;This trylock serves which purpose?
Quoted 2 lines
Well we don't want to start changing clocksource if something is running like you pointed out.
Well yes, but ....
Quoted 3 lines
Quoted 1 line
I really cannot see how this is proper serialized.
We need to allow this only from the last cpu before hitting idle.
And I cannot see anything which does so.
cpu0 cpu1
is_idlego_idle()
clocksource_pm_enter()
lock(cs_mutex);
wakeup()
clocksource_pm_exit()
trylock fails ....
...
unlock(cs_mutex);--> Crap!
Quoted 15 lines
Quoted 14 lines
Review int timekeeping_notify(struct clocksource *clock) · line 1095
Quoted 12 lines
(quoted diff) +7
-1@@ -1086,7 +1086,18 @@ int timekeeping_notify(struct clocksource *clock) if (tk->tkr_mono.clock == clock) return 0; - stop_machine(change_clocksource, clock, NULL); + + /* + * We may want to toggle between a fast and a persistent + * clocksource from CPUidle on the last active CPU and can't + * use stop_machine at that point. + */ + if (cpumask_test_cpu(smp_processor_id(), cpu_online_mask) &&Can you please explain how this code gets called from an offline cpu?
Quoted 1 line
Last cpu getting idled..
That does not make any sense at all. How is idle related to the online mask? An idle cpu is still online.
Quoted 8 lines
Quoted 5 lines
Review int timekeeping_notify(struct clocksource *clock) · line 1096
Quoted 1 line
(quoted diff) +1
-0+ !rcu_is_watching())So pick some random combination of conditions and define that it is correct, right? How on earth does !rcu_watching() tell that this is the last running cpu.
We have called
rcu_idle_enter()fromcpuidle_idle_call(). Do you have some better test in mind when the last cpu is about hit idle?
The cpuidle code should know that. And if it does not know, it better should keep track of that information and based on it provide the proper serialization, so the call into the timekeeping code is not a subject to guess work and race conditions.
Thanks,
tglx
Tony Lindgren
maintainerQuoted 53 lines · Thomas Gleixner
Quoted 9 lines · Tony Lindgren
Quoted 1 line · Thomas Gleixner
On Mon, 6 Jul 2015, Tony Lindgren wrote:
The timekeeping accuracy issue certainly needs some thinking, and also the resolution between the clocksources can be different.. In the test case I have the slow timer is always on and of a lower resolution than the ARM global timer being used during runtime.
Got some handy timer test in mind you want me to run to provide data on the accuracy?
John Stultz might have something.
Quoted 17 lines
Quoted 8 lines
Quoted 8 lines
(quoted diff) +8
-0+/** + * clocksource_pm_enter - change to a persistent clocksource before idle + * + * Changes system to use a persistent clocksource for idle. Intended to + * be called from CPUidle from the last active CPU. + */ +int clocksource_pm_enter(void) +{Quoted 8 lines
Review
Quoted 6 lines
(quoted diff) +6
-0+ bool oneshot = tick_oneshot_mode_active(); + struct clocksource *best; + + if (WARN_ONCE(!mutex_trylock(&clocksource_mutex), + "Unable to get clocksource_mutex")) + return -EINTR;This trylock serves which purpose?
Quoted 2 lines
Well we don't want to start changing clocksource if something is running like you pointed out.
Well yes, but ....
Quoted 3 lines
Quoted 1 line
I really cannot see how this is proper serialized.
We need to allow this only from the last cpu before hitting idle.
And I cannot see anything which does so.
cpu0 cpu1
is_idlego_idle()
clocksource_pm_enter()lock(cs_mutex); wakeup() clocksource_pm_exit() trylock fails .... ... unlock(cs_mutex);
Quoted 1 line
--> Crap!
OK you're right, this only works with cpuidle and using drivers/cpuidle/coupled.c.
Quoted 15 lines
Quoted 15 lines
Quoted 14 lines
Review int timekeeping_notify(struct clocksource *clock) · line 1095
Quoted 12 lines
(quoted diff) +7
-1@@ -1086,7 +1086,18 @@ int timekeeping_notify(struct clocksource *clock) if (tk->tkr_mono.clock == clock) return 0; - stop_machine(change_clocksource, clock, NULL); + + /* + * We may want to toggle between a fast and a persistent + * clocksource from CPUidle on the last active CPU and can't + * use stop_machine at that point. + */ + if (cpumask_test_cpu(smp_processor_id(), cpu_online_mask) &&Can you please explain how this code gets called from an offline cpu?
Quoted 4 lines
Quoted 1 line
Last cpu getting idled..
That does not make any sense at all. How is idle related to the online mask? An idle cpu is still online.
Oops yeah that's a bogus test, cpu off != offlined.
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Review int timekeeping_notify(struct clocksource *clock) · line 1096
Quoted 1 line
(quoted diff) +1
-0+ !rcu_is_watching())So pick some random combination of conditions and define that it is correct, right? How on earth does !rcu_watching() tell that this is the last running cpu.
Quoted 7 lines
Quoted 2 lines
We have called
rcu_idle_enter()fromcpuidle_idle_call(). Do you have some better test in mind when the last cpu is about hit idle?The cpuidle code should know that. And if it does not know, it better should keep track of that information and based on it provide the proper serialization, so the call into the timekeeping code is not a subject to guess work and race conditions.
OK I agree. Based on your comments this clearly needs to be limited to cpuidle. And thanks for your comments.
Regards,
Tony
Quoted 8 lines · Thomas Gleixner
Quoted 7 lines · Tony Lindgren
Quoted 1 line · Thomas Gleixner
On Mon, 6 Jul 2015, Tony Lindgren wrote:
The timekeeping accuracy issue certainly needs some thinking, and also the resolution between the clocksources can be different.. In the test case I have the slow timer is always on and of a lower resolution than the ARM global timer being used during runtime.
Quoted 4 lines
Quoted 2 lines
Got some handy timer test in mind you want me to run to provide data on the accuracy?
John Stultz might have something.
You can turn on ntp stats in your ntp.conf and chart the loopstats data w/ gnuplot:
set terminal png
set output "loopstat.png"
plot "/var/log/ntpstats/loopstats.<dateoftest>" using 2:3 with linespoints
I also have the drift-log.py and graph-log.py scripts I use here:
https://github.com/johnstultz-work/timetests
But those aren't really ready for mass consumption, as they're probably not very cross-distro compatible.
thanks
-john
Tony Lindgren
maintainerQuoted 22 lines · John Stultz
Quoted 8 lines · Thomas Gleixner
Quoted 7 lines · Tony Lindgren
Quoted 1 line · Thomas Gleixner
On Mon, 6 Jul 2015, Tony Lindgren wrote:
The timekeeping accuracy issue certainly needs some thinking, and also the resolution between the clocksources can be different.. In the test case I have the slow timer is always on and of a lower resolution than the ARM global timer being used during runtime.
Quoted 4 lines
Quoted 2 lines
Got some handy timer test in mind you want me to run to provide data on the accuracy?
John Stultz might have something.
You can turn on ntp stats in your ntp.conf and chart the loopstats data w/ gnuplot:
set terminal png
set output "loopstat.png"
plot "/var/log/ntpstats/loopstats.<dateoftest>" using 2:3 with linespoints
Quoted 5 lines
I also have the
drift-log.pyandgraph-log.pyscripts I use here:
https://github.com/johnstultz-work/timetestsBut those aren't really ready for mass consumption, as they're probably not very cross-distro compatible.
Great thanks, I'll play a bit with those to see how bad the jitter gets.
Regrds,
Tony
Quoted 4 lines · Tony Lindgren
Some persistent clocksources can be on a slow external bus. For shorter latencies for RT use, let's allow toggling the clocksource during idle between a faster non-persistent runtime clocksource and a slower persistent clocksource.
So yea, as Thomas mentioned, this will cause problems for timekeeping accuracy, since we end up resetting the ntp state when we change clocksource (additionally you gain a bit of error each time you switch clocksources). So you'll most likely see trouble w/ ntpd steering the clock.
I'm not sure its quite clear in the description as to the need here. Could you expand a bit as to the rational for why? I assume it has to do with you have a high-res clocksource that is good for fine-grained clock_gettime() calls, but wraps quickly, making it poor for long idle times. So you're trying to swap to a less fine grained clocksource that won't wrap so fast?
The persistent-clock-like name muddies things further, since the persistent-clock is used for suspend, while it looks like this is just for idle times.
thanks
-john
Quoted 19 lines · John Stultz
Quoted 4 lines · Tony Lindgren
Some persistent clocksources can be on a slow external bus. For shorter latencies for RT use, let's allow toggling the clocksource during idle between a faster non-persistent runtime clocksource and a slower persistent clocksource.
So yea, as Thomas mentioned, this will cause problems for timekeeping accuracy, since we end up resetting the ntp state when we change clocksource (additionally you gain a bit of error each time you switch clocksources). So you'll most likely see trouble w/ ntpd steering the clock.
I'm not sure its quite clear in the description as to the need here. Could you expand a bit as to the rational for why? I assume it has to do with you have a high-res clocksource that is good for fine-grained
clock_gettime()calls, but wraps quickly, making it poor for long idle times. So you're trying to swap to a less fine grained clocksource that won't wrap so fast?
Quoted 3 lines
The persistent-clock-like name muddies things further, since the persistent-clock is used for suspend, while it looks like this is just for idle times.
Though that are idle states where the cpu is powered off so the fast clock source is powered off as well....
We all know how well that works from the x86/TSC horror. It's just the same thing again with a different arch prefix.
Thanks,
tglx
Quoted 24 lines · Thomas Gleixner
Quoted 19 lines · John Stultz
Quoted 4 lines · Tony Lindgren
Some persistent clocksources can be on a slow external bus. For shorter latencies for RT use, let's allow toggling the clocksource during idle between a faster non-persistent runtime clocksource and a slower persistent clocksource.
So yea, as Thomas mentioned, this will cause problems for timekeeping accuracy, since we end up resetting the ntp state when we change clocksource (additionally you gain a bit of error each time you switch clocksources). So you'll most likely see trouble w/ ntpd steering the clock.
I'm not sure its quite clear in the description as to the need here. Could you expand a bit as to the rational for why? I assume it has to do with you have a high-res clocksource that is good for fine-grained
clock_gettime()calls, but wraps quickly, making it poor for long idle times. So you're trying to swap to a less fine grained clocksource that won't wrap so fast?Quoted 3 lines
The persistent-clock-like name muddies things further, since the persistent-clock is used for suspend, while it looks like this is just for idle times.
Quoted 5 lines
Though that are idle states where the cpu is powered off so the fast clock source is powered off as well....
We all know how well that works from the x86/TSC horror. It's just the same thing again with a different arch prefix.
Right.. and it might be telling that on x86 systems with this issue, we don't play games with it and that sort of hardware just has to use the slower and less fine-grained clocksources all the time.
thanks
-john
Tony Lindgren
maintainerQuoted 28 lines · John Stultz
Quoted 27 lines · Thomas Gleixner
Quoted 19 lines · John Stultz
Quoted 4 lines · Tony Lindgren
Some persistent clocksources can be on a slow external bus. For shorter latencies for RT use, let's allow toggling the clocksource during idle between a faster non-persistent runtime clocksource and a slower persistent clocksource.
So yea, as Thomas mentioned, this will cause problems for timekeeping accuracy, since we end up resetting the ntp state when we change clocksource (additionally you gain a bit of error each time you switch clocksources). So you'll most likely see trouble w/ ntpd steering the clock.
I'm not sure its quite clear in the description as to the need here. Could you expand a bit as to the rational for why? I assume it has to do with you have a high-res clocksource that is good for fine-grained
clock_gettime()calls, but wraps quickly, making it poor for long idle times. So you're trying to swap to a less fine grained clocksource that won't wrap so fast?Quoted 3 lines
The persistent-clock-like name muddies things further, since the persistent-clock is used for suspend, while it looks like this is just for idle times.
Though that are idle states where the cpu is powered off so the fast clock source is powered off as well....
Quoted 6 lines
Quoted 2 lines
We all know how well that works from the x86/TSC horror. It's just the same thing again with a different arch prefix.
Right.. and it might be telling that on x86 systems with this issue, we don't play games with it and that sort of hardware just has to use the slower and less fine-grained clocksources all the time.
Yes it's similar to the old x86 TSC vs ACPI PM timer issue. We have ARM global timer powered off during idle.
It may be best to just use kernel cmdline to select the ARM global timer and then disable any deeper power states if ARM global timer is selected.
Regards,
Tony