Page MenuHomeFreeBSD

Add a custom implementation of cpu_lock_delay() for x86.
ClosedPublic

Authored by jhb on Nov 5 2018, 6:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 16, 4:47 AM
Unknown Object (File)
Fri, Nov 15, 9:54 PM
Unknown Object (File)
Sun, Nov 10, 7:04 AM
Unknown Object (File)
Sat, Nov 9, 2:51 AM
Unknown Object (File)
Sat, Nov 9, 2:34 AM
Unknown Object (File)
Thu, Oct 31, 5:41 AM
Unknown Object (File)
Oct 3 2024, 10:00 PM
Unknown Object (File)
Oct 2 2024, 10:05 PM
Subscribers

Details

Summary

Avoid using DELAY() since it can try to use spin locks on CPUs without a
P-state invariant TSC. For cpu_lock_delay(), always use the TSC if it
exists (even if it is not P-state invariant) to delay for a microsecond.
If the TSC does not exist, read from I/O port 0x84 to delay instead.

PR: 228768

Test Plan
  • passed make tinderbox (aside from unrelated breakage in arm.GENERIC-NODEBUG)
  • booted in i386 and amd64 VMs
  • original PR reporter booted combined patch on amd64 machine

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib added inline comments.
sys/x86/x86/delay.c
125 ↗(On Diff #50034)

And there a comment why tsc_is_invariant check is omitted would be useful IMO.

This revision is now accepted and ready to land.Nov 5 2018, 9:21 PM
This revision now requires review to proceed.Nov 5 2018, 9:43 PM
jhb marked an inline comment as done.Nov 5 2018, 9:44 PM
This revision is now accepted and ready to land.Nov 5 2018, 9:59 PM
This revision was automatically updated to reflect the committed changes.