+ if (!throttled) {+ /* mark as potentially idle for the upcoming period */+ cfs_b->idle = 1;+ goto out_unlock;+ }++ /*+ * There are throttled entities so we must first use the new bandwidth+ * to unthrottle them before making it generally available. This+ * ensures that all existing debts will be paid before a new cfs_rq is+ * allowed to run.+ */+ runtime = cfs_b->runtime;+ runtime_expires = cfs_b->runtime_expires;+ cfs_b->runtime = 0;++ /*+ * This check is repeated as we are holding onto the new bandwidth+ * while we unthrottle. This can potentially race with an unthrottled+ * group trying to acquire new bandwidth from the global pool.+ */+ while (throttled && runtime > 0) {+ raw_spin_unlock(&cfs_b->lock);+ /* we can't nest cfs_b->lock while distributing bandwidth */+ runtime = distribute_cfs_runtime(cfs_b, runtime,+ runtime_expires);+ raw_spin_lock(&cfs_b->lock);++ throttled = !list_empty(&cfs_b->throttled_cfs_rq);+ }

- /* mark as potentially idle for the upcoming period */- cfs_b->idle = 1;+ /* return (any) remaining runtime */+ cfs_b->runtime = runtime;+ /*+ * While we are ensured activity in the period following an+ * unthrottle, this also covers the case in which the new bandwidth is+ * insufficient to cover the existing bandwidth deficit. (Forcing the+ * timer to remain active while there are any throttled entities.)+ */+ cfs_b->idle = 0; out_unlock: if (idle) cfs_b->timer_active = 0;