- * - If the majority of the most recent idle duration values are below the
- * target residency of the idle state selected so far, use those values to
- * compute the new expected idle duration and find an idle state matching it
- * (which has to be shallower than the one selected so far).
+ * 1. Find the deepest CPU idle state whose target residency does not exceed
+ * the current sleep length (the candidate idle state) and compute two sums
+ * as follows:
+ *
+ * - The sum of the "hits" and "intercepts" metrics for the candidate state
+ * and all of the deeper idle states (it represents the cases in which the
+ * CPU was idle long enough to avoid being intercepted if the sleep length
+ * had been equal to the current one).
+ *
+ * - The sum of the "intercepts" metrics for all of the idle states shallower
+ * than the candidate one (it represents the cases in which the CPU was not
+ * idle long enough to avoid being intercepted if the sleep length had been
+ * equal to the current one).
+ *
+ * 2. If the second sum is greater than the first one, look for an alternative
+ * idle state to select.
+ *
+ * - Traverse the idle states shallower than the candidate one in the
+ * descending order.
+ *
+ * - For each of them compute the sum of the "intercepts" metrics over all of
+ * the idle states between it and the candidate one (including the former
+ * and excluding the latter).
+ *
+ * - If that sum is greater than a half of the second sum computed in step 1
+ * (which means that the target residency of the state in question had not
+ * exceeded the idle duration in over a half of the relevant cases), select
+ * the given idle state instead of the candidate one.
+ *
+ * 3. If the majority of the most recent idle duration values are below the
+ * current anticipated idle duration, use those values to compute the new
+ * expected idle duration and find an idle state matching it (which has to
+ * be shallower than the current candidate one).