HomeFreeBSD

tslog: Annotate parts of SYSINIT cpu

Description

tslog: Annotate parts of SYSINIT cpu

Booting an amd64 kernel on Firecracker with 1 CPU and 128 MB of RAM,
SYSINIT cpu takes roughly 2770 us:

  • 2280 us in vm_ksubmap_init
    • 535 us in kmem_malloc
      • 450 us in pmap_zero_page
    • 1720 us in pmap_growkernel
      • 1620 us in pmap_zero_page
  • 80 us in bufinit
  • 480 us in cpu_setregs
    • 430 us in cpu_setregs calling load_cr0

Much of this is hypervisor overhead: load_cr0 is slow because it traps
to the hypervisor, and 99% of the time in pmap_zero_page is spent when
we first touch the page, presumably due to the host Linux kernel
faulting in backing pages one by one.

Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D40327

Details

Provenance
cpercivaAuthored on May 30 2023, 12:29 AM
Differential Revision
D40327: Annotate parts of SYSINIT cpu with tslog
Parents
rG2404380aac7e: tslog: Optionally instrument pmap_zero_page
Branches
Unknown
Tags
Unknown