Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Dec 2003 10:26:20 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 44032 for review
Message-ID:  <200312171826.hBHIQK9o076198@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=44032

Change 44032 by jhb@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;
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200312171826.hBHIQK9o076198>