Message ID | 554727A0.3040601@free.fr (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Mon, May 04, 2015 at 10:02:40AM +0200, Mason wrote: > (The system's clocksource is a 27 MHz 32-bit counter.) > > If I remove the CLOCK_EVT_FEAT_C3STOP flag, then hrtimers are enabled, > but I assume I would then run into problems in low-power mode, going by > Russell's commit message. It seems that you've done the research, and judging from the question you ask below, you already know the answer: > Do I have to use a platform-specific clockevent source if I want > high-resolution timers on the system? Yes - because the TWD stops in low power modes, which makes it unsuitable as a high-resolution timer. These kinds of issues are annoying, but it's the way things are.
On 06/05/2015 13:19, Russell King - ARM Linux wrote: > On Mon, May 04, 2015 at 10:02:40AM +0200, Mason wrote: >> (The system's clocksource is a 27 MHz 32-bit counter.) >> >> If I remove the CLOCK_EVT_FEAT_C3STOP flag, then hrtimers are enabled, >> but I assume I would then run into problems in low-power mode, going by >> Russell's commit message. > > It seems that you've done the research, and judging from the question > you ask below, you already know the answer: > >> Do I have to use a platform-specific clockevent source if I want >> high-resolution timers on the system? > > Yes - because the TWD stops in low power modes, which makes it unsuitable > as a high-resolution timer. These kinds of issues are annoying, but it's > the way things are. Hello Russell and LAKML readers, I did dig pretty deep while investigating the issue, but there are still some aspects of the problem that are not clear to me. The most important is: what exactly is meant by "low power modes". Does the idle loop calling wfi send the system into low power mode? Are there several low power modes? How are these modes entered and exited? Is this documented in the ARM reference manual? or in the Cortex A9 technical manual? The other thing I don't understand is: if the TWD stops in low power mode, then that means the system would not even receive the scheduling tick anymore? Wouldn't that break even coarse timers? Does that mean using TWD as clockevent source is incompatible with CONFIG_HZ_PERIODIC=y? (So we must pick CONFIG_NO_HZ_IDLE=y or CONFIG_NO_HZ_FULL=y) https://www.kernel.org/doc/Documentation/timers/NO_HZ.txt High-resolution timers are a "nice-to-have" feature, but I think being able to use vanilla code is an overriding factor. I just wish there was a way to get hrtimers while using standard vanilla code :-) Regards.
On 07/05/2015 10:49, Mason wrote: > On 06/05/2015 13:19, Russell King - ARM Linux wrote: >> On Mon, May 04, 2015 at 10:02:40AM +0200, Mason wrote: >>> (The system's clocksource is a 27 MHz 32-bit counter.) >>> >>> If I remove the CLOCK_EVT_FEAT_C3STOP flag, then hrtimers are enabled, >>> but I assume I would then run into problems in low-power mode, going by >>> Russell's commit message. >> >> It seems that you've done the research, and judging from the question >> you ask below, you already know the answer: >> >>> Do I have to use a platform-specific clockevent source if I want >>> high-resolution timers on the system? >> >> Yes - because the TWD stops in low power modes, which makes it unsuitable >> as a high-resolution timer. These kinds of issues are annoying, but it's >> the way things are. > > Hello Russell and LAKML readers, > > I did dig pretty deep while investigating the issue, but there are still > some aspects of the problem that are not clear to me. > > The most important is: what exactly is meant by "low power modes". > Does the idle loop calling wfi send the system into low power mode? > Are there several low power modes? > How are these modes entered and exited? > Is this documented in the ARM reference manual? > or in the Cortex A9 technical manual? > > The other thing I don't understand is: if the TWD stops in low power > mode, then that means the system would not even receive the scheduling > tick anymore? Wouldn't that break even coarse timers? > > Does that mean using TWD as clockevent source is incompatible with > CONFIG_HZ_PERIODIC=y? > (So we must pick CONFIG_NO_HZ_IDLE=y or CONFIG_NO_HZ_FULL=y) > > https://www.kernel.org/doc/Documentation/timers/NO_HZ.txt > > High-resolution timers are a "nice-to-have" feature, but I > think being able to use vanilla code is an overriding factor. > I just wish there was a way to get hrtimers while using > standard vanilla code :-) Hello all, Is there, perhaps, a better place to discuss these issues? (IRC, web forum, other mailing list, Stack Overflow, ...) Regards.
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c index 7c5f0c0..35882fb 100644 --- a/arch/arm/kernel/smp_twd.c +++ b/arch/arm/kernel/smp_twd.c @@ -132,7 +132,8 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk) twd_calibrate_rate(); clk->name = "local_timer"; - clk->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; + clk->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT | + CLOCK_EVT_FEAT_C3STOP; clk->rating = 350; clk->set_mode = twd_set_mode; clk->set_next_event = twd_set_next_event;