i386/85653: [patch] relieve hangs in tight loops in processor support

Ben Thomas bthomas at virtualiron.com
Fri Sep 2 18:00:41 GMT 2005


>Number:         85653
>Category:       i386
>Synopsis:       [patch] relieve hangs in tight loops in processor support
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-i386
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 02 18:00:36 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Ben Thomas
>Release:        FreeBSD 5.4-RELEASE i386
>Organization:
Virtual Iron Software
>Environment:
System: FreeBSD bthomas4.katana-technology.com 5.4-RELEASE FreeBSD 5.4-RELEASE #10: Sun Aug 28 13:48:00 EDT 2005 ben at bthomas4.katana-technology.com:/usr/obj/usr/home/ben/BSD/RELENG_5_4_0_RELEASE/src/sys/BEN i386


>Description:
This is one of a few changes we've made to relieve hangs in SMP systems.
We've seen hangs for stop/start CPUs, during reboots and at other
inopportune times.  Generally, the hangs are pretty hard and have
been interesting to debug.  In the end, we isolated a number of places
and inserted a "pause" instruction to break very tight data access
loops.  This has resolved our issues.  We have some other patches to
help with these issues, but they probably need more clean-up before
attempting to submit them.

This patch is against the 5_4_0_RELEASE code

>How-To-Repeat:
>Fix:

--- apic_vector.s-DIFF begins here ---
--- /usr/src.original/sys/i386/i386/apic_vector.s	Wed Jan  5 21:02:35 2005
+++ /usr/src/sys/i386/i386/apic_vector.s	Thu Aug 11 17:36:09 2005
@@ -288,6 +288,7 @@
 	btsl	%eax, CNAME(stopped_cpus) /* stopped_cpus |= (1<<id) */
 1:
 	btl	%eax, CNAME(started_cpus) /* while (!(started_cpus & (1<<id))) */
+	pause				  /* Give others a chance ! */
 	jnc	1b
 
 	lock
--- apic_vector.s-DIFF ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-i386 mailing list