From owner-p4-projects@FreeBSD.ORG Fri Aug 20 17:28:04 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2BEF016A4D0; Fri, 20 Aug 2004 17:28:03 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D8EAA16A4CE for ; Fri, 20 Aug 2004 17:28:02 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CEBCA43D31 for ; Fri, 20 Aug 2004 17:28:02 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i7KHS2tf031684 for ; Fri, 20 Aug 2004 17:28:02 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i7KHS2hP031681 for perforce@freebsd.org; Fri, 20 Aug 2004 17:28:02 GMT (envelope-from jhb@freebsd.org) Date: Fri, 20 Aug 2004 17:28:02 GMT Message-Id: <200408201728.i7KHS2hP031681@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 60154 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2004 17:28:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=60154 Change 60154 by jhb@jhb_slimer on 2004/08/20 17:27:23 Yay for cpu_spinwait() and fewer ugly #ifdefs! Affected files ... .. //depot/projects/smpng/sys/kern/kern_shutdown.c#47 edit .. //depot/projects/smpng/sys/kern/subr_smp.c#34 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_shutdown.c#47 (text+ko) ==== @@ -500,11 +500,8 @@ */ if (panic_thread != curthread) while (atomic_cmpset_ptr(&panic_thread, NULL, curthread) == 0) - while (panic_thread != NULL) { -#ifdef __i386__ - ia32_pause(); -#endif - } + while (panic_thread != NULL) + cpu_spinwait(); #endif bootopt = RB_AUTOBOOT | RB_DUMP; ==== //depot/projects/smpng/sys/kern/subr_smp.c#34 (text+ko) ==== @@ -229,9 +229,7 @@ i = 0; while ((stopped_cpus & map) != map) { /* spin */ -#ifdef __i386__ - ia32_pause(); -#endif + cpu_spinwait(); i++; #ifdef DIAGNOSTIC if (i == 100000) { @@ -271,12 +269,9 @@ atomic_store_rel_int(&started_cpus, map); /* wait for each to clear its bit */ - while ((stopped_cpus & map) != 0) { -#ifdef __i386__ - ia32_pause(); -#endif + while ((stopped_cpus & map) != 0) /* nothing */ - } + cpu_spinwait(); return 1; }