/[base]
ViewVC logotype

Revision 340269


Jump to revision: Previous Next
Author: jhb
Date: Thu Nov 8 22:39:38 2018 UTC (5 years, 7 months ago)
Changed paths: 11
Log Message:
MFC 340164,340168,340170: Add custom cpu_lock_delay() for x86.

340164:
Add a KPI for the delay while spinning on a spin lock.

Replace a call to DELAY(1) with a new cpu_lock_delay() KPI.  Currently
cpu_lock_delay() is defined to DELAY(1) on all platforms.  However,
platforms with a DELAY() implementation that uses spin locks should
implement a custom cpu_lock_delay() doesn't use locks.

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

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.

340170:
Add a custom implementation of cpu_lock_delay() for x86.

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
Approved by:	re (gjb)


Changed paths

Path Details
Directorystable/12/ modified , props changed
Directorystable/12/sys/amd64/include/cpu.h modified , text changed
Directorystable/12/sys/arm/include/cpu.h modified , text changed
Directorystable/12/sys/arm64/include/cpu.h modified , text changed
Directorystable/12/sys/i386/include/cpu.h modified , text changed
Directorystable/12/sys/kern/kern_mutex.c modified , text changed
Directorystable/12/sys/mips/include/cpu.h modified , text changed
Directorystable/12/sys/powerpc/include/cpu.h modified , text changed
Directorystable/12/sys/riscv/include/cpu.h modified , text changed
Directorystable/12/sys/sparc64/include/cpu.h modified , text changed
Directorystable/12/sys/x86/x86/delay.c modified , text changed

  ViewVC Help
Powered by ViewVC 1.1.27