svn commit: r297039 - head/sys/x86/x86
John Baldwin
jhb at FreeBSD.org
Fri Mar 18 19:48:50 UTC 2016
Author: jhb
Date: Fri Mar 18 19:48:49 2016
New Revision: 297039
URL: https://svnweb.freebsd.org/changeset/base/297039
Log:
Check IPI status more frequently when waiting.
An IPI cannot be sent via the local APIC if a previous IPI is still
being delivered. Attempts to send an IPI will wait for a pending IPI
to clear. Prior to r278325 these checks used a spin loop with a
hardcoded maximum count which broke AP startup on some systems.
However, r278325 also enforced a minimum latency of 5 microseconds if an
IPI was still pending which resulted in a measurable performance hit.
This change reduces that minimum latency to 1 microsecond.
Tested by: stas
MFC after: 3 days
Modified:
head/sys/x86/x86/local_apic.c
Modified: head/sys/x86/x86/local_apic.c
==============================================================================
--- head/sys/x86/x86/local_apic.c Fri Mar 18 19:36:43 2016 (r297038)
+++ head/sys/x86/x86/local_apic.c Fri Mar 18 19:48:49 2016 (r297039)
@@ -1641,11 +1641,11 @@ native_lapic_ipi_wait(int delay)
return (1);
}
- for (x = 0; x < delay; x += 5) {
+ for (x = 0; x < delay; x++) {
if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) ==
APIC_DELSTAT_IDLE)
return (1);
- DELAY(5);
+ DELAY(1);
}
return (0);
}
More information about the svn-src-all
mailing list