runqslower(8)
π¦ NAME π¦
bestie, this is runqslower (manual section 8) π it's a System Manager's Manual page and the whole thing is about tracing long process scheduling delays β¨
runqslower - Trace long process scheduling delays.
π SYNOPSIS π
runqslower [-p PID] [-t TID] [-P] [min_us]
β¨ DESCRIPTION β¨
okay so this tool measures how long a task sits waiting on a run queue (or whatever equivalent scheduler data structure is in play) for its turn on-CPU, and then it shows you every time that wait goes over the threshold you pass in π«Ά the wait should be small, but a task might have to wait its turn because the CPU is busy. the higher the CPU load, the longer a task will generally need to wait its turn π
this tool measures two types of run queue latency, and it's giving science class π
- The time from a task being enqueued on a run queue to its context switch and execution. This traces
ttwu_do_wakeup(),wake_up_new_task()->finish_task_switch()with either raw tracepoints (if supported) or kprobes, and it instruments the run queue latency after a voluntary context switch. - The time from when a task was involuntary context switched and still in the runnable state, to when it next executed. This is instrumented from
finish_task_switch()alone.
β οΈ bestie, heads up: the overhead of this tool may become significant for some workloads. check the OVERHEAD section before you go wild with it π
this works by tracing various kernel scheduler functions using dynamic tracing, so it will need updating to match any changes to those functions π§
also, since this uses BPF, only the root user can use this tool π no sneaking in as a regular user, periodt.
π REQUIREMENTS π
you'll need CONFIG_BPF and bcc π§
β¨ OPTIONS β¨
-hβ prints the usage message π-p PIDβ only shows this PID πΈ (it gets filtered in the kernel, so it's efficient)-t TIDβ only shows this TID π (also filtered in the kernel for efficiency)min_usβ the minimum scheduling delay, in microseconds, that gets output π¦-Pβ also shows the previous task's comm and TID π
π EXAMPLES π
show scheduling delays longer than 10ms:
# runqslower
show scheduling delays longer than 1ms for the process with PID 123:
# runqslower -p 123 1000
π FIELDS π
TIMEβ when the scheduling event happened β°COMMβ the process name πPIDβ the process ID πͺͺLAT(us)β the scheduling latency, from the moment the task was ready to run until the moment it got assigned to a CPU to run π₯
π OVERHEAD π
okay real talk bestie, this traces scheduler functions, and those can get very frequent π eBPF has super low overhead and this tool uses in-kernel maps for efficiency, but for some workloads the frequency of scheduler events can be high enough that the overhead of this tool becomes significant. so measure in a lab environment to quantify the overhead before you use it for real π§ͺ
π«Ά SOURCE π«Ά
this one is from bcc π¦
https://github.com/iovisor/bcc
also go look in the bcc distribution for a companion _examples.txt file, which has example usage, output, and commentary for this tool π
πΈ OS πΈ
Linux π§
π STABILITY π
Unstable - in development. it's still cooking, so don't be shocked if things shift π³
π AUTHOR π
Ivan Babrou made the original BCC Python version, and Andrii Nakryiko made the CO-RE version π
π SEE ALSO π
runqlen(8), runqlat(8), pidstat(1) β¨
bestie that's the whole tea π«π this page is for runqslower(8) from the USER COMMANDS section, dated 2016-02-07, and it's sourced from bcc. no cap, you're going to be a scheduling latency legend π§π
π¦ where this page comes from
- debian bookworm: bpfcc-tools 0.26.0+ds-1 Β· Apache-2.0
- debian trixie: bpfcc-tools 0.31.0+ds-7 Β· Apache-2.0
- ubuntu noble: bpfcc-tools 0.29.1+ds-1ubuntu7 Β· Apache-2.0
- ubuntu questing: bpfcc-tools 0.31.0+ds-7ubuntu2 Β· Apache-2.0
- ubuntu resolute: bpfcc-tools 0.35.0+ds-1ubuntu2 Β· Apache-2.0
- ubuntu stonking: bpfcc-tools 0.35.0+ds-1ubuntu4 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms