mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Artur Onysko <onyskoartur@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: [RFC] sched: clarify why cpu.stat throttled_usec deltas can exceed elapsed time
Date: Tue, 1 Dec 2026 18:39:32 +0000	[thread overview]
Message-ID: <CACarHMschY0GvUcJOrgUfTd0H_A-nuZ-Mf-1516vLSzkSpmcVQ@mail.gmail.com> (raw)

Hi,

cgroup v2 cpu.stat exports throttled_usec from cfs_b->throttled_time.
The CFS unthrottle path accumulates elapsed time from individual per-CPU
CFS run queues. Overlapping throttle intervals add to the same group
counter. In the simple example of two run queues each accumulating 10 ms
within the same 10 ms interval, the counter can advance by 20 ms.

Could the CFS bandwidth or cgroup v2 documentation say explicitly that
this statistic is cumulative run-queue throttle time and provide a small
example? A reader computing delta(throttled_usec) / elapsed time should
expect values above one. The example would make the existing units usable
without proposing a change to accounting.

https://github.com/torvalds/linux/blob/693c2e04e3f1d4c59af236e1211b7b8cb165a790/kernel/sched/fair.c#L7240-L7248
https://github.com/torvalds/linux/blob/693c2e04e3f1d4c59af236e1211b7b8cb165a790/kernel/sched/core.c#L10404-L10423
https://docs.kernel.org/scheduler/sched-bwc.html#statistics

The example is source-derived arithmetic. A delegated multi-CPU runtime
measurement is still needed. Source review and this RFC draft were
assisted by Codex.

Thanks,
Artur Onysko

                 reply	other threads:[~2026-12-01 18:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACarHMschY0GvUcJOrgUfTd0H_A-nuZ-Mf-1516vLSzkSpmcVQ@mail.gmail.com \
    --to=onyskoartur@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®