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)
Nov 16 2024, 4:47 AM
Unknown Object (File)
Nov 15 2024, 9:54 PM
Unknown Object (File)
Nov 10 2024, 7:04 AM
Unknown Object (File)
Nov 9 2024, 2:51 AM
Unknown Object (File)
Nov 9 2024, 2:34 AM
Unknown Object (File)
Oct 31 2024, 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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 20646
Build 20062: arc lint + arc unit

Event Timeline

kib added inline comments.
sys/x86/x86/delay.c
135

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.