1- NO_HZ: Reducing Scheduling-Clock Ticks
1+ ======================================
2+ NO_HZ: Reducing Scheduling-Clock Ticks
3+ ======================================
24
35
46This document describes Kconfig options and boot parameters that can
@@ -28,7 +30,8 @@ by a third section on RCU-specific considerations, a fourth section
2830discussing 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
3336Very old versions of Linux from the 1990s and the very early 2000s
3437are incapable of omitting scheduling-clock ticks. It turns out that
@@ -59,7 +62,8 @@ degrade your applications performance. If this describes your workload,
5962you 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
6468If a CPU is idle, there is little point in sending it a scheduling-clock
6569interrupt. 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
97101dyntick-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
102107If a CPU has only one runnable task, there is little point in sending it
103108a 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
179185There are situations in which idle CPUs cannot be permitted to
180186enter 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
199205where you want them to run.
200206
201207
202- TESTING
208+ Testing
209+ =======
203210
204211So you enable all the OS-jitter features described in this document,
205212but 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
222229systems.
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
0 commit comments