Page MenuHomeFreeBSD

TSLOG: Optionally instrument pmap_zero_page
ClosedPublic

Authored by cperciva on May 30 2023, 3:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 21 2024, 1:37 AM
Unknown Object (File)
Mar 21 2024, 1:31 AM
Unknown Object (File)
Mar 19 2024, 7:25 PM
Unknown Object (File)
Mar 19 2024, 7:12 PM
Unknown Object (File)
Dec 20 2023, 5:07 AM
Unknown Object (File)
Dec 12 2023, 2:40 PM
Unknown Object (File)
Dec 3 2023, 10:25 AM
Unknown Object (File)
Dec 3 2023, 10:22 AM
Subscribers

Details

Summary

Booting an amd64 kernel on Firecracker with 1 CPU and 128 MB of RAM,
pmap_zero_page is responsible for 4.6 ms of the 25.0 ms of boot time.
This is not in fact time spent zeroing pages though; almost all of
that time is spent in a first-touch penalty, presumably due to the
host Linux kernel faulting in backing pages one by one.

There's probably a way to improve that by teaching Firecracker to
fault in all the VM's pages from the start rather than having them
faulted in one at a time, but that's outside of FreeBSD's control.

This commit adds a TSLOG_PAGEZERO option which enables TSLOG on the
amd64 pmap_zero_page function; it's a separate option (turned off
by default even if TSLOG is enabled) since zeroing pages happens
enough that it can easily fill the TSLOG buffer and prevent other
timing information from being recorded.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable