linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 00/21] hrtimer - High-resolution timer subsystem
@ 2005-12-06  0:01 tglx
  2005-12-06  0:01 ` [patch 01/21] Move div_long_long_rem out of jiffies.h tglx
                   ` (21 more replies)
  0 siblings, 22 replies; 74+ messages in thread
From: tglx @ 2005-12-06  0:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, rostedt, johnstul, zippel, mingo

This is a major rework of the former ktimer subsystem. It replaces the 
ktimer patch series and drops the ktimeout series completely.

A broken out series is available from
http://www.tglx.de/projects/ktimers/patches-2.6.15-rc5-hrtimer.tar.bz2

1. Naming

After the extensive discussions on LKML, Andrew Morton suggested 
"hrtimer" and we picked it up. While the hrtimer subsystem does not 
offer high-resolution clock sources just yet, the subsystem can be 
easily extended with high-resolution clock capabilities. The rework of 
the ktimer-hrt patches is the next step.

2. More simplifications

We worked through the subsystem and its users and further reduced the 
implementation to the basic required infrastructure and generally 
streamlined it. (We did this with easy extensibility for the high 
resolution clock support still in mind, so we kept some small extras 
around.)

The new .text overhead (on x86) we believe speaks for itself:

    text    data     bss     dec     hex filename
 2468380  547212  155164 3170756  3061c4 vmlinux-2.6.15-rc2
 2469996  548016  155164 3173176  306b38 vmlinux-ktimer-rc5-mm1
 2468164  547508  155100 3170772  3061d4 vmlinux-hrtimer

While it was +1616 bytes before, it's -216 bytes now. This also gives a 
new justification for hrtimers: it reduces .text overhead ;-) [ There's 
still some .data overhead, but it's acceptable at 0.1%.]

On 64-bit platforms such as x64 there are even more .text savings:

    text    data     bss     dec     hex filename
 3853431  914316  403880 5171627  4ee9ab vmlinux-x64-2.6.15-rc5
 3852407  914548  403752 5170707  4ee613 vmlinux-x64-hrtimer

(due to the compactness of 64-bit ktime_t ops)

Other 32-bit platforms (arm, ppc) have a much smaller .text 
hrtimers footprint now too.

3. Fixes

The last splitup of ktimers resulted in a bug in the overrun accounting.  
This bug is now fixed and the code verified for correctness.

4. Rounding

We looked at the runtime behaviour of vanilla, ktimers and ptimers to 
figure out the consequences for applications in a more detailed way.

The rounding of time values and intervals leads to rather unpredictible 
results which deviates of the current mainline implementation 
significantly and introduces unpredictible behaviour vs. the timeline.

After reading the Posix specification again, we came to the conclusion 
that it is possible to do no rounding at all for the ktime_t values, and 
to still ensure that the timer is not delivered early.

".. and that timers must wait for the next clock tick after the 
theoretical expiration time, to ensure that a timer never returns too 
soon. Note also that the granularity of the clock may be significantly 
coarser than the resolution of the data format used to set and get time 
and interval values. Also note that some implementations may choose to 
adjust time and/or interval values to exactly match the ticks of the 
underlying clock."

Which allows the already discussed part of the spec to be interpreted 
differently:

"Time values that are between two consecutive non-negative integer 
multiples of the resolution of the specified timer shall be rounded up 
to the larger multiple of the resolution. Quantization error shall not 
cause the timer to expire earlier than the rounded time value."

The rounding of the time value i.e. the expiry time itself must be
rounded to the next clock tick, to ensure that a timer never expires
early.

	Thomas, Ingo

--


^ permalink raw reply	[flat|nested] 74+ messages in thread
* Re: [patch 00/21] hrtimer - High-resolution timer subsystem
@ 2005-12-13 12:45 Nicolas Mailhot
  2005-12-13 23:38 ` George Anzinger
  0 siblings, 1 reply; 74+ messages in thread
From: Nicolas Mailhot @ 2005-12-13 12:45 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Roman Zippel, linux-kernel

"This is your interpretation and I disagree.

If I set up a timer with a 24 hour interval, which should go off
everyday at 6:00 AM, then I expect that this timer does this even when
the clock is set e.g. by daylight saving. I think, that this is a
completely valid interpretation and makes a lot of sense from a
practical point of view. The existing implementation does it that way
already, so why do we want to change this ?"

Please do not hardcode anywhere 1 day = 24h or something like this.
Relative timers should stay relative not depend on DST.

If someone needs a timer that sets of everyday at the same (legal) time,
make him ask for everyday at that time not one time + n x 24h.

Some processes need an exact legal hour
Other processes need an exact duration

In a DST world that's not the same thing at all - don't assume one or the
other, have coders request exactly what they need and everyone will be
happy.

I can tell from experience trying to fix code which assumed one day = 24h
is not fun at all. And yes sometimes the difference between legal and UTC
time matters a lot.

-- 
Nicolas Mailhot


^ permalink raw reply	[flat|nested] 74+ messages in thread

end of thread, other threads:[~2005-12-22  4:31 UTC | newest]

Thread overview: 74+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-06  0:01 [patch 00/21] hrtimer - High-resolution timer subsystem tglx
2005-12-06  0:01 ` [patch 01/21] Move div_long_long_rem out of jiffies.h tglx
2005-12-06  0:01 ` [patch 02/21] Remove duplicate div_long_long_rem implementation tglx
2005-12-06  0:01 ` [patch 03/21] Deinline mktime and set_normalized_timespec tglx
2005-12-06  0:01 ` [patch 04/21] Clean up mktime and make arguments const tglx
2005-12-06  0:01 ` [patch 05/21] Export deinlined mktime tglx
2005-12-06  0:01 ` [patch 06/21] Remove unused clock constants tglx
2005-12-06  0:01 ` [patch 07/21] Coding style clean up of " tglx
2005-12-06  0:01 ` [patch 08/21] Coding style and white space cleanup tglx
2005-12-06  0:01 ` [patch 09/21] Make clockid_t arguments const tglx
2005-12-06  0:01 ` [patch 10/21] Coding style and white space cleanup tglx
2005-12-06  0:01 ` [patch 11/21] Create and use timespec_valid macro tglx
2005-12-06  0:01 ` [patch 12/21] Validate timespec of do_sys_settimeofday tglx
2005-12-06  0:01 ` [patch 13/21] Introduce nsec_t type and conversion functions tglx
2005-12-06  0:01 ` [patch 14/21] Introduce ktime_t time format tglx
2005-12-06  0:01 ` [patch 15/21] hrtimer core code tglx
2005-12-15  3:43   ` Matt Helsley
2005-12-06  0:01 ` [patch 16/21] hrtimer documentation tglx
2005-12-06  0:01 ` [patch 17/21] Switch itimers to hrtimer tglx
2005-12-06  0:01 ` [patch 18/21] Create hrtimer nanosleep API tglx
2005-12-06  0:01 ` [patch 19/21] Switch sys_nanosleep to hrtimer tglx
2005-12-06  0:01 ` [patch 20/21] Switch clock_nanosleep to hrtimer nanosleep API tglx
2005-12-06  0:01 ` [patch 21/21] Convert posix timers completely tglx
2005-12-06 17:32 ` [patch 00/21] hrtimer - High-resolution timer subsystem Roman Zippel
2005-12-06 19:07   ` Ingo Molnar
2005-12-07  3:05     ` Roman Zippel
2005-12-08  5:18       ` Paul Jackson
2005-12-08  8:12         ` Ingo Molnar
2005-12-08  9:26       ` Ingo Molnar
2005-12-08 13:08         ` Roman Zippel
2005-12-08 15:36           ` Steven Rostedt
2005-12-06 22:10   ` Thomas Gleixner
2005-12-07  3:11     ` Roman Zippel
2005-12-06 22:28   ` Thomas Gleixner
2005-12-07  9:31     ` Andrew Morton
2005-12-07 10:11       ` Ingo Molnar
2005-12-07 10:20         ` Ingo Molnar
2005-12-07 10:23         ` Nick Piggin
2005-12-07 10:49           ` Ingo Molnar
2005-12-07 11:09             ` Nick Piggin
2005-12-07 11:33               ` Ingo Molnar
2005-12-07 11:40                 ` Nick Piggin
2005-12-07 13:06                 ` Roman Zippel
2005-12-07 12:40               ` Roman Zippel
2005-12-07 23:12                 ` Nick Piggin
2005-12-07 12:18     ` Roman Zippel
2005-12-07 16:55       ` Ingo Molnar
2005-12-07 17:17         ` Roman Zippel
2005-12-07 17:57           ` Ingo Molnar
2005-12-07 18:18             ` Roman Zippel
2005-12-07 18:02           ` Paul Baxter
2005-12-09 17:23       ` Thomas Gleixner
2005-12-12 13:39         ` Roman Zippel
2005-12-12 16:42           ` Thomas Gleixner
2005-12-12 18:37             ` Thomas Gleixner
2005-12-13  1:25             ` George Anzinger
2005-12-13  9:18               ` Thomas Gleixner
2005-12-15  1:35               ` Roman Zippel
2005-12-15  2:29                 ` George Anzinger
2005-12-19 14:56                   ` Roman Zippel
2005-12-19 20:54                     ` George Anzinger
2005-12-21 23:03                       ` Roman Zippel
2005-12-22  4:30                         ` George Anzinger
2005-12-14 20:48             ` Roman Zippel
2005-12-14 22:30               ` Thomas Gleixner
2005-12-15  0:55                 ` George Anzinger
2005-12-15 14:18                 ` Steven Rostedt
2005-12-19 14:50                 ` Roman Zippel
2005-12-19 22:05                   ` Thomas Gleixner
2005-12-13 12:45 Nicolas Mailhot
2005-12-13 23:38 ` George Anzinger
2005-12-14  8:58   ` Kyle Moffett
2005-12-14 10:03   ` Nicolas Mailhot
2005-12-15  1:11     ` George Anzinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).