Skip to content

boot/systemd: measure PID 1's own steps; systemd experiments in the lab - #283

Merged
aledbf merged 3 commits into
mainfrom
pid1-marks
Nov 19, 2026
Merged

aledbf merged 3 commits into
mainfrom
pid1-marks

Conversation

@aledbf

@aledbf aledbf commented Nov 19, 2026

Copy link
Copy Markdown
Member

Kept as tooling for the next systemd experiments:

  • image/systemd applies experiments/<name>.patch when SYSTEMD_EXPERIMENT names one. The image never does.
  • lab.yml systemd_experiment builds that systemd on the runner, before anything is measured, and boot:waits puts it into each overlay (SPIN_SYSTEMD_DEBS).
  • experiments/pid1-marks.patch makes PID 1 append its monotonic clock, its own CPU time, the units loaded and the time in unit_load after each step of manager_startup and do_queue_default_job. boot:waits prints each step's p50.

Bench fleet, 10 boots (lab 44561762624):

step wall ms PID 1 CPU ms units
bus, varlink, coldplug, vacuum, ready < 0.2 together
load what default.target reaches 28.4 20.9 192
build the transaction 0.30 0.30
first dispatch 0.87 0.78

The ~30 ms gap after the unit load is unit loading, ~0.11 ms of CPU per unit. It is not the transaction, which 11-13's single debug-logged boot had named. docs/log.md and the comment in waits_probe_test.go are corrected. Next: a per-unit load profile, then a row that deletes the unit files no boot here runs.

🤖 Generated with Claude Code

aledbf and others added 3 commits November 19, 2026 13:23
… job

image/systemd builds an experiment's patch when SYSTEMD_EXPERIMENT names
one; experiments/pid1-marks makes PID 1 append its monotonic clock to
/run/spin-pid1-marks after each step of manager_startup and
do_queue_default_job. boot:waits puts SPIN_SYSTEMD_DEBS into each
overlay and gives each step's p50; lab.yml's systemd_experiment builds
the packages on the runner before anything is measured. The ~32 ms gap
had been "explained, not removable" from one debug-logged boot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n unit_load

Wall time well above PID 1's own CPU time in a step is waiting - on the
disk or for a CPU - rather than parsing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aledbf
aledbf merged commit b661785 into main Nov 19, 2026
3 checks passed
@aledbf
aledbf deleted the pid1-marks branch November 19, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant