PERFORCE change 44032 for review

John Baldwin jhb at FreeBSD.org
Wed Dec 17 10:26:35 PST 2003


http://perforce.freebsd.org/chv.cgi?CH=44032

Change 44032 by jhb at jhb_laptop on 2003/12/17 10:25:26

	- Don't need to use atomic_load_acq() to read stopped_cpus.
	- Use pause in the stopped_cpus spin loops.

Affected files ...

.. //depot/projects/smpng/sys/kern/subr_smp.c#25 edit

Differences ...

==== //depot/projects/smpng/sys/kern/subr_smp.c#25 (text+ko) ====

@@ -219,8 +219,11 @@
 	ipi_selected(map, IPI_STOP);
 	
 	i = 0;
-	while ((atomic_load_acq_int(&stopped_cpus) & map) != map) {
+	while ((stopped_cpus & map) != map) {
 		/* spin */
+#ifdef __i386__
+		ia32_pause();
+#endif
 		i++;
 #ifdef DIAGNOSTIC
 		if (i == 100000) {
@@ -260,8 +263,12 @@
 	atomic_store_rel_int(&started_cpus, map);
 
 	/* wait for each to clear its bit */
-	while ((atomic_load_acq_int(&stopped_cpus) & map) != 0)
-		;	/* nothing */
+	while (stopped_cpus & map) != 0) {
+#ifdef __i386__
+		ia32_pause();
+#endif
+		/* nothing */
+	}
 
 	return 1;
 }


More information about the p4-projects mailing list