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, Apr 27, 6:24 PM
Unknown Object (File)
Fri, Apr 26, 10:25 PM
Unknown Object (File)
Fri, Apr 26, 9:57 PM
Unknown Object (File)
Fri, Apr 26, 9:30 PM
Unknown Object (File)
Mar 4 2024, 8:11 AM
Unknown Object (File)
Feb 10 2024, 1:17 AM
Unknown Object (File)
Dec 27 2023, 1:54 AM
Unknown Object (File)
Dec 22 2023, 11:06 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.