Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Mar 2016 19:48:49 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r297039 - head/sys/x86/x86
Message-ID:  <201603181948.u2IJmndg063765@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201603181948.u2IJmndg063765>