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);
 }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to