From bthomas@virtualiron.com  Fri Sep  2 17:58:36 2005
Return-Path: <bthomas@virtualiron.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5E73416A41F
	for <freeBSD-gnats-submit@freebsd.org>; Fri,  2 Sep 2005 17:58:36 +0000 (GMT)
	(envelope-from bthomas@virtualiron.com)
Received: from mail.virtualiron.com (mail.virtualiron.com [209.213.88.114])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 02DEC43D46
	for <freeBSD-gnats-submit@freebsd.org>; Fri,  2 Sep 2005 17:58:35 +0000 (GMT)
	(envelope-from bthomas@virtualiron.com)
Received: from [10.1.2.26] ([10.1.2.26]) by mail.virtualiron.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Fri, 2 Sep 2005 13:59:11 -0400
Message-Id: <431892CB.5060800@virtualiron.com>
Date: Fri, 02 Sep 2005 13:58:35 -0400
From: Ben Thomas <bthomas@virtualiron.com>
To: freeBSD-gnats-submit@freebsd.org
Subject: [patch] relieve hangs in tight loops in processor support

>Number:         85653
>Category:       i386
>Synopsis:       [i386] [patch] relieve hangs in tight loops in processor support
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-i386
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 02 18:00:36 GMT 2005
>Closed-Date:    Wed Mar 30 06:08:46 UTC 2011
>Last-Modified:  Wed Mar 30 06:08:46 UTC 2011
>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@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:
State-Changed-From-To: open->feedback 
State-Changed-By: remko 
State-Changed-When: Wed Mar 23 07:20:09 UTC 2011 
State-Changed-Why:  
Hello, a lot of code changes had happened since 5.4 release, and 
many many improvements had been made to the SMP stack. Can you 
confirm whether this error is still accurate on recent systems like 
8.x? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=85653 
State-Changed-From-To: feedback->closed 
State-Changed-By: remko 
State-Changed-When: Wed Mar 30 06:08:45 UTC 2011 
State-Changed-Why:  
Issues with the SMP system hadn't been reported for a while, so this is 
most likely resolved. If not please get back to me. (Dicussed with 
Alexander Best). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=85653 
>Unformatted:
