PERFORCE change 60154 for review
John Baldwin
jhb at FreeBSD.org
Fri Aug 20 10:28:04 PDT 2004
http://perforce.freebsd.org/chv.cgi?CH=60154
Change 60154 by jhb at 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;
}
More information about the p4-projects
mailing list