@@ -275,20 +275,25 @@ values and, when predicting the idle duration next time, it computes the average
275
275
and variance of them. If the variance is small (smaller than 400 square
276
276
milliseconds) or it is small relative to the average (the average is greater
277
277
that 6 times the standard deviation), the average is regarded as the "typical
278
- interval" value. Otherwise, the longest of the saved observed idle duration
278
+ interval" value. Otherwise, either the longest or the shortest (depending on
279
+ which one is farther from the average) of the saved observed idle duration
279
280
values is discarded and the computation is repeated for the remaining ones.
281
+
280
282
Again, if the variance of them is small (in the above sense), the average is
281
283
taken as the "typical interval" value and so on, until either the "typical
282
- interval" is determined or too many data points are disregarded, in which case
283
- the "typical interval" is assumed to equal "infinity" (the maximum unsigned
284
- integer value).
285
-
286
- If the "typical interval" computed this way is long enough, the governor obtains
287
- the time until the closest timer event with the assumption that the scheduler
288
- tick will be stopped. That time, referred to as the *sleep length * in what follows,
289
- is the upper bound on the time before the next CPU wakeup. It is used to determine
290
- the sleep length range, which in turn is needed to get the sleep length correction
291
- factor.
284
+ interval" is determined or too many data points are disregarded. In the latter
285
+ case, if the size of the set of data points still under consideration is
286
+ sufficiently large, the next idle duration is not likely to be above the largest
287
+ idle duration value still in that set, so that value is taken as the predicted
288
+ next idle duration. Finally, if the set of data points still under
289
+ consideration is too small, no prediction is made.
290
+
291
+ If the preliminary prediction of the next idle duration computed this way is
292
+ long enough, the governor obtains the time until the closest timer event with
293
+ the assumption that the scheduler tick will be stopped. That time, referred to
294
+ as the *sleep length * in what follows, is the upper bound on the time before the
295
+ next CPU wakeup. It is used to determine the sleep length range, which in turn
296
+ is needed to get the sleep length correction factor.
292
297
293
298
The ``menu `` governor maintains an array containing several correction factor
294
299
values that correspond to different sleep length ranges organized so that each
@@ -302,7 +307,7 @@ to 1 the correction factor becomes (it must fall between 0 and 1 inclusive).
302
307
The sleep length is multiplied by the correction factor for the range that it
303
308
falls into to obtain an approximation of the predicted idle duration that is
304
309
compared to the "typical interval" determined previously and the minimum of
305
- the two is taken as the idle duration prediction.
310
+ the two is taken as the final idle duration prediction.
306
311
307
312
If the "typical interval" value is small, which means that the CPU is likely
308
313
to be woken up soon enough, the sleep length computation is skipped as it may
0 commit comments