Skip to content

Commit 458f69e

Browse files
mchehabJonathan Corbet
authored andcommitted
docs: timers: convert docs to ReST and rename to *.rst
The conversion here is really trivial: just a bunch of title markups and very few puntual changes is enough to make it to be parsed by Sphinx and generate a nice html. The conversion is actually: - add blank lines and identation in order to identify paragraphs; - fix tables markups; - add some lists markups; - mark literal blocks; - adjust title markups. At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
1 parent 4ca9bc2 commit 458f69e

14 files changed

Lines changed: 84 additions & 43 deletions

File tree

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
=====================================================
12
High resolution timers and dynamic ticks design notes
2-
-----------------------------------------------------
3+
=====================================================
34

45
Further information can be found in the paper of the OLS 2006 talk "hrtimers
56
and beyond". The paper is part of the OLS 2006 Proceedings Volume 1, which can
@@ -30,11 +31,12 @@ hrtimer base infrastructure
3031
---------------------------
3132

3233
The hrtimer base infrastructure was merged into the 2.6.16 kernel. Details of
33-
the base implementation are covered in Documentation/timers/hrtimers.txt. See
34+
the base implementation are covered in Documentation/timers/hrtimers.rst. See
3435
also figure #2 (OLS slides p. 15)
3536

3637
The main differences to the timer wheel, which holds the armed timer_list type
3738
timers are:
39+
3840
- time ordered enqueueing into a rb-tree
3941
- independent of ticks (the processing is based on nanoseconds)
4042

@@ -55,7 +57,8 @@ merged into the 2.6.18 kernel.
5557

5658
Further information about the Generic Time Of Day framework is available in the
5759
OLS 2005 Proceedings Volume 1:
58-
http://www.linuxsymposium.org/2005/linuxsymposium_procv1.pdf
60+
61+
http://www.linuxsymposium.org/2005/linuxsymposium_procv1.pdf
5962

6063
The paper "We Are Not Getting Any Younger: A New Approach to Time and
6164
Timers" was written by J. Stultz, D.V. Hart, & N. Aravamudan.
@@ -100,6 +103,7 @@ accounting, profiling, and high resolution timers.
100103

101104
The management layer assigns one or more of the following functions to a clock
102105
event device:
106+
103107
- system global periodic tick (jiffies update)
104108
- cpu local update_process_times
105109
- cpu local profiling
@@ -244,6 +248,3 @@ extended to x86_64 and ARM already. Initial (work in progress) support is also
244248
available for MIPS and PowerPC.
245249

246250
Thomas, Ingo
247-
248-
249-
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
High Precision Event Timer Driver for Linux
1+
===========================================
2+
High Precision Event Timer Driver for Linux
3+
===========================================
24

35
The High Precision Event Timer (HPET) hardware follows a specification
46
by Intel and Microsoft, revision 1.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
1+
======================================================
22
hrtimers - subsystem for high-resolution kernel timers
3-
----------------------------------------------------
3+
======================================================
44

55
This patch introduces a new subsystem for high-resolution kernel timers.
66

@@ -146,7 +146,7 @@ the clock_getres() interface. This will return whatever real resolution
146146
a given clock has - be it low-res, high-res, or artificially-low-res.
147147

148148
hrtimers - testing and verification
149-
----------------------------------
149+
-----------------------------------
150150

151151
We used the high-resolution clock subsystem ontop of hrtimers to verify
152152
the hrtimer implementation details in praxis, and we also ran the posix

‎Documentation/timers/index.rst‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
:orphan:
2+
3+
======
4+
timers
5+
======
6+
7+
.. toctree::
8+
:maxdepth: 1
9+
10+
highres
11+
hpet
12+
hrtimers
13+
no_hz
14+
timekeeping
15+
timers-howto
16+
17+
.. only:: subproject and html
18+
19+
Indices
20+
=======
21+
22+
* :ref:`genindex`
Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
NO_HZ: Reducing Scheduling-Clock Ticks
1+
======================================
2+
NO_HZ: Reducing Scheduling-Clock Ticks
3+
======================================
24

35

46
This document describes Kconfig options and boot parameters that can
@@ -28,7 +30,8 @@ by a third section on RCU-specific considerations, a fourth section
2830
discussing testing, and a fifth and final section listing known issues.
2931

3032

31-
NEVER OMIT SCHEDULING-CLOCK TICKS
33+
Never Omit Scheduling-Clock Ticks
34+
=================================
3235

3336
Very old versions of Linux from the 1990s and the very early 2000s
3437
are incapable of omitting scheduling-clock ticks. It turns out that
@@ -59,7 +62,8 @@ degrade your applications performance. If this describes your workload,
5962
you should read the following two sections.
6063

6164

62-
OMIT SCHEDULING-CLOCK TICKS FOR IDLE CPUs
65+
Omit Scheduling-Clock Ticks For Idle CPUs
66+
=========================================
6367

6468
If a CPU is idle, there is little point in sending it a scheduling-clock
6569
interrupt. After all, the primary purpose of a scheduling-clock interrupt
@@ -97,7 +101,8 @@ By default, CONFIG_NO_HZ_IDLE=y kernels boot with "nohz=on", enabling
97101
dyntick-idle mode.
98102

99103

100-
OMIT SCHEDULING-CLOCK TICKS FOR CPUs WITH ONLY ONE RUNNABLE TASK
104+
Omit Scheduling-Clock Ticks For CPUs With Only One Runnable Task
105+
================================================================
101106

102107
If a CPU has only one runnable task, there is little point in sending it
103108
a scheduling-clock interrupt because there is no other task to switch to.
@@ -174,7 +179,8 @@ However, the drawbacks listed above mean that adaptive ticks should not
174179
(yet) be enabled by default.
175180

176181

177-
RCU IMPLICATIONS
182+
RCU Implications
183+
================
178184

179185
There are situations in which idle CPUs cannot be permitted to
180186
enter either dyntick-idle mode or adaptive-tick mode, the most
@@ -199,7 +205,8 @@ scheduler will decide where to run them, which might or might not be
199205
where you want them to run.
200206

201207

202-
TESTING
208+
Testing
209+
=======
203210

204211
So you enable all the OS-jitter features described in this document,
205212
but do not see any change in your workload's behavior. Is this because
@@ -222,9 +229,10 @@ We do not currently have a good way to remove OS jitter from single-CPU
222229
systems.
223230

224231

225-
KNOWN ISSUES
232+
Known Issues
233+
============
226234

227-
o Dyntick-idle slows transitions to and from idle slightly.
235+
* Dyntick-idle slows transitions to and from idle slightly.
228236
In practice, this has not been a problem except for the most
229237
aggressive real-time workloads, which have the option of disabling
230238
dyntick-idle mode, an option that most of them take. However,
@@ -248,13 +256,13 @@ o Dyntick-idle slows transitions to and from idle slightly.
248256
this parameter effectively disables Turbo Mode on Intel
249257
CPUs, which can significantly reduce maximum performance.
250258

251-
o Adaptive-ticks slows user/kernel transitions slightly.
259+
* Adaptive-ticks slows user/kernel transitions slightly.
252260
This is not expected to be a problem for computationally intensive
253261
workloads, which have few such transitions. Careful benchmarking
254262
will be required to determine whether or not other workloads
255263
are significantly affected by this effect.
256264

257-
o Adaptive-ticks does not do anything unless there is only one
265+
* Adaptive-ticks does not do anything unless there is only one
258266
runnable task for a given CPU, even though there are a number
259267
of other situations where the scheduling-clock tick is not
260268
needed. To give but one example, consider a CPU that has one
@@ -275,20 +283,20 @@ o Adaptive-ticks does not do anything unless there is only one
275283

276284
Better handling of these sorts of situations is future work.
277285

278-
o A reboot is required to reconfigure both adaptive idle and RCU
286+
* A reboot is required to reconfigure both adaptive idle and RCU
279287
callback offloading. Runtime reconfiguration could be provided
280288
if needed, however, due to the complexity of reconfiguring RCU at
281289
runtime, there would need to be an earthshakingly good reason.
282290
Especially given that you have the straightforward option of
283291
simply offloading RCU callbacks from all CPUs and pinning them
284292
where you want them whenever you want them pinned.
285293

286-
o Additional configuration is required to deal with other sources
294+
* Additional configuration is required to deal with other sources
287295
of OS jitter, including interrupts and system-utility tasks
288296
and processes. This configuration normally involves binding
289297
interrupts and tasks to particular CPUs.
290298

291-
o Some sources of OS jitter can currently be eliminated only by
299+
* Some sources of OS jitter can currently be eliminated only by
292300
constraining the workload. For example, the only way to eliminate
293301
OS jitter due to global TLB shootdowns is to avoid the unmapping
294302
operations (such as kernel module unload operations) that
@@ -299,17 +307,17 @@ o Some sources of OS jitter can currently be eliminated only by
299307
helpful, especially when combined with the mlock() and mlockall()
300308
system calls.
301309

302-
o Unless all CPUs are idle, at least one CPU must keep the
310+
* Unless all CPUs are idle, at least one CPU must keep the
303311
scheduling-clock interrupt going in order to support accurate
304312
timekeeping.
305313

306-
o If there might potentially be some adaptive-ticks CPUs, there
314+
* If there might potentially be some adaptive-ticks CPUs, there
307315
will be at least one CPU keeping the scheduling-clock interrupt
308316
going, even if all CPUs are otherwise idle.
309317

310318
Better handling of this situation is ongoing work.
311319

312-
o Some process-handling operations still require the occasional
320+
* Some process-handling operations still require the occasional
313321
scheduling-clock tick. These operations include calculating CPU
314322
load, maintaining sched average, computing CFS entity vruntime,
315323
computing avenrun, and carrying out load balancing. They are
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
===========================================================
12
Clock sources, Clock events, sched_clock() and delay timers
2-
-----------------------------------------------------------
3+
===========================================================
34

45
This document tries to briefly explain some basic kernel timekeeping
56
abstractions. It partly pertains to the drivers usually found in
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
===================================================================
12
delays - Information on the various kernel delay / sleep mechanisms
2-
-------------------------------------------------------------------
3+
===================================================================
34

45
This document seeks to answer the common question: "What is the
56
RightWay (TM) to insert a delay?"
@@ -17,7 +18,7 @@ code in an atomic context?" This should be followed closely by "Does
1718
it really need to delay in atomic context?" If so...
1819

1920
ATOMIC CONTEXT:
20-
You must use the *delay family of functions. These
21+
You must use the `*delay` family of functions. These
2122
functions use the jiffie estimation of clock speed
2223
and will busy wait for enough loop cycles to achieve
2324
the desired delay:
@@ -35,21 +36,26 @@ ATOMIC CONTEXT:
3536
be refactored to allow for the use of msleep.
3637

3738
NON-ATOMIC CONTEXT:
38-
You should use the *sleep[_range] family of functions.
39+
You should use the `*sleep[_range]` family of functions.
3940
There are a few more options here, while any of them may
4041
work correctly, using the "right" sleep function will
4142
help the scheduler, power management, and just make your
4243
driver better :)
4344

4445
-- Backed by busy-wait loop:
46+
4547
udelay(unsigned long usecs)
48+
4649
-- Backed by hrtimers:
50+
4751
usleep_range(unsigned long min, unsigned long max)
52+
4853
-- Backed by jiffies / legacy_timers
54+
4955
msleep(unsigned long msecs)
5056
msleep_interruptible(unsigned long msecs)
5157

52-
Unlike the *delay family, the underlying mechanism
58+
Unlike the `*delay` family, the underlying mechanism
5359
driving each of these calls varies, thus there are
5460
quirks you should be aware of.
5561

@@ -70,6 +76,7 @@ NON-ATOMIC CONTEXT:
7076
- Why not msleep for (1ms - 20ms)?
7177
Explained originally here:
7278
http://lkml.org/lkml/2007/8/3/250
79+
7380
msleep(1~20) may not do what the caller intends, and
7481
will often sleep longer (~20 ms actual sleep for any
7582
value given in the 1~20ms range). In many cases this

‎MAINTAINERS‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7192,7 +7192,7 @@ F: drivers/net/ethernet/hp/hp100.*
71927192
HPET: High Precision Event Timers driver
71937193
M: Clemens Ladisch <clemens@ladisch.de>
71947194
S: Maintained
7195-
F: Documentation/timers/hpet.txt
7195+
F: Documentation/timers/hpet.rst
71967196
F: drivers/char/hpet.c
71977197
F: include/linux/hpet.h
71987198
F: include/uapi/linux/hpet.h

‎drivers/media/usb/dvb-usb-v2/anysee.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static int anysee_ctrl_msg(struct dvb_usb_device *d,
5656
/* TODO FIXME: dvb_usb_generic_rw() fails rarely with error code -32
5757
* (EPIPE, Broken pipe). Function supports currently msleep() as a
5858
* parameter but I would not like to use it, since according to
59-
* Documentation/timers/timers-howto.txt it should not be used such
59+
* Documentation/timers/timers-howto.rst it should not be used such
6060
* short, under < 20ms, sleeps. Repeating failed message would be
6161
* better choice as not to add unwanted delays...
6262
* Fixing that correctly is one of those or both;

‎drivers/regulator/core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2304,7 +2304,7 @@ static int regulator_ena_gpio_ctrl(struct regulator_dev *rdev, bool enable)
23042304
*
23052305
* Delay for the requested amount of time as per the guidelines in:
23062306
*
2307-
* Documentation/timers/timers-howto.txt
2307+
* Documentation/timers/timers-howto.rst
23082308
*
23092309
* The assumption here is that regulators will never be enabled in
23102310
* atomic context and therefore sleeping functions can be used.

0 commit comments

Comments
 (0)