Page MenuHomeFreeBSD

Add a delay_tsc() static function for when DELAY() uses the TSC.
ClosedPublic

Authored by jhb on Nov 5 2018, 6:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 4, 3:45 AM
Unknown Object (File)
Thu, Oct 3, 6:07 PM
Unknown Object (File)
Thu, Oct 3, 3:43 PM
Unknown Object (File)
Thu, Oct 3, 6:51 AM
Unknown Object (File)
Thu, Oct 3, 6:37 AM
Unknown Object (File)
Thu, Oct 3, 4:02 AM
Unknown Object (File)
Thu, Oct 3, 3:57 AM
Unknown Object (File)
Wed, Oct 2, 4:26 PM
Subscribers

Details

Summary

This uses slightly simpler logic than the existing code by using the
full 64-bit counter and thus not having to worry about counter overflow.

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

sys/x86/x86/delay.c
59 ↗(On Diff #50033)

Please add a comment explaining why sched_pin() is needed.

77 ↗(On Diff #50033)

Perhaps there another comment is needed, noting that tsc_is_invariant check prevent too long delays.

jhb marked 2 inline comments 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.