Page MenuHomeFreeBSD

vlapic: Schedule callouts on the local CPU
ClosedPublic

Authored by markj on Oct 19 2021, 3:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 1 2024, 12:41 PM
Unknown Object (File)
Sep 21 2024, 7:37 AM
Unknown Object (File)
Aug 24 2024, 10:13 PM
Unknown Object (File)
Aug 11 2024, 11:31 AM
Unknown Object (File)
Jun 21 2024, 9:14 PM
Unknown Object (File)
Jun 8 2024, 7:03 PM
Unknown Object (File)
May 25 2024, 11:15 AM
Unknown Object (File)
May 25 2024, 11:00 AM
Subscribers

Details

Summary

The virtual LAPIC driver uses callouts to implement the LAPIC timer.
Callouts are armed using callout_reset_sbt(), which currently puts
everything on CPU 0. On systems running many small bhyve VMs this
results in a large amount of contention for CPU 0's callout lock.

I can't see a reason to schedule everything on CPU 0. While the callout
interface should perhaps be changed to schedule on the current CPU by
default, it's easy to change vlapic to avoid the problem. With this
diff I can see callouts getting scheduled across all CPUs in the system
in my workload, and callout lock contention is mostly gone.

Diff Detail

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

Event Timeline

markj requested review of this revision.Oct 19 2021, 3:34 PM
This revision is now accepted and ready to land.Oct 19 2021, 6:22 PM

This may have been leftover from some early soft-partitioning work where the host was running on CPU 0 (and low CPUs) with bhyve and a single-guest running on the remainder with halt-exits disabled.

This revision was automatically updated to reflect the committed changes.