Skip to content

Commit 4c093cb

Browse files
geertuJonathan Corbet
authored andcommitted
Documentation: timers: hrtimers: Make hybrid union historical
Non-scalar time was removed from the ktime hybrid union in v3.17, and the union itself followed suit in v4.10. Make it clear that ktime_t is always a 64bit scalar type, to avoid confusing the casual reader. While at it, fix a spelling mistake. Fixes: 24e4a8c ("ktime: Kill non-scalar ktime_t implementation for 2038") Fixes: 2456e85 ("ktime: Get rid of the union") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/59250a3d1c2c827b5c1833169a6e652ca6a784e6.1683021785.git.geert+renesas@glider.be Signed-off-by: Jonathan Corbet <corbet@lwn.net>
1 parent 0b65631 commit 4c093cb

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

Documentation/timers/hrtimers.rst

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,17 +123,12 @@ equivalent to timer_delete() and timer_delete_sync()] - so there's no direct
123123
potential for code sharing either.
124124

125125
Basic data types: every time value, absolute or relative, is in a
126-
special nanosecond-resolution type: ktime_t. The kernel-internal
127-
representation of ktime_t values and operations is implemented via
128-
macros and inline functions, and can be switched between a "hybrid
129-
union" type and a plain "scalar" 64bit nanoseconds representation (at
130-
compile time). The hybrid union type optimizes time conversions on 32bit
131-
CPUs. This build-time-selectable ktime_t storage format was implemented
132-
to avoid the performance impact of 64-bit multiplications and divisions
133-
on 32bit CPUs. Such operations are frequently necessary to convert
134-
between the storage formats provided by kernel and userspace interfaces
135-
and the internal time format. (See include/linux/ktime.h for further
136-
details.)
126+
special nanosecond-resolution 64bit type: ktime_t.
127+
(Originally, the kernel-internal representation of ktime_t values and
128+
operations was implemented via macros and inline functions, and could be
129+
switched between a "hybrid union" type and a plain "scalar" 64bit
130+
nanoseconds representation (at compile time). This was abandoned in the
131+
context of the Y2038 work.)
137132

138133
hrtimers - rounding of timer values
139134
-----------------------------------
@@ -148,7 +143,7 @@ a given clock has - be it low-res, high-res, or artificially-low-res.
148143
hrtimers - testing and verification
149144
-----------------------------------
150145

151-
We used the high-resolution clock subsystem ontop of hrtimers to verify
146+
We used the high-resolution clock subsystem on top of hrtimers to verify
152147
the hrtimer implementation details in praxis, and we also ran the posix
153148
timer tests in order to ensure specification compliance. We also ran
154149
tests on low-resolution clocks.

0 commit comments

Comments
 (0)