svn commit: r227889 - releng/9.0/sys/kern

Attilio Rao attilio at FreeBSD.org
Wed Nov 23 15:41:56 UTC 2011


Author: attilio
Date: Wed Nov 23 15:41:55 2011
New Revision: 227889
URL: http://svn.freebsd.org/changeset/base/227889

Log:
  MFC r227058:
  Disable interrupt and preemption for smp_rendezvous() also in the
  UP/!SMP case.
  
  Sponsored by: Sandvine Incorporated
  Approved by:	re (kib)

Modified:
  releng/9.0/sys/kern/subr_smp.c
Directory Properties:
  releng/9.0/sys/   (props changed)
  releng/9.0/sys/amd64/include/xen/   (props changed)
  releng/9.0/sys/boot/   (props changed)
  releng/9.0/sys/boot/i386/efi/   (props changed)
  releng/9.0/sys/boot/ia64/efi/   (props changed)
  releng/9.0/sys/boot/ia64/ski/   (props changed)
  releng/9.0/sys/boot/powerpc/boot1.chrp/   (props changed)
  releng/9.0/sys/boot/powerpc/ofw/   (props changed)
  releng/9.0/sys/cddl/contrib/opensolaris/   (props changed)
  releng/9.0/sys/conf/   (props changed)
  releng/9.0/sys/contrib/dev/acpica/   (props changed)
  releng/9.0/sys/contrib/octeon-sdk/   (props changed)
  releng/9.0/sys/contrib/pf/   (props changed)
  releng/9.0/sys/contrib/x86emu/   (props changed)

Modified: releng/9.0/sys/kern/subr_smp.c
==============================================================================
--- releng/9.0/sys/kern/subr_smp.c	Wed Nov 23 15:37:03 2011	(r227888)
+++ releng/9.0/sys/kern/subr_smp.c	Wed Nov 23 15:41:55 2011	(r227889)
@@ -415,13 +415,16 @@ smp_rendezvous_cpus(cpuset_t map,
 {
 	int curcpumap, i, ncpus = 0;
 
+	/* Look comments in the !SMP case. */
 	if (!smp_started) {
+		spinlock_enter();
 		if (setup_func != NULL)
 			setup_func(arg);
 		if (action_func != NULL)
 			action_func(arg);
 		if (teardown_func != NULL)
 			teardown_func(arg);
+		spinlock_exit();
 		return;
 	}
 
@@ -666,12 +669,18 @@ smp_rendezvous_cpus(cpuset_t map,
 	void (*teardown_func)(void *),
 	void *arg)
 {
+	/*
+	 * In the !SMP case we just need to ensure the same initial conditions
+	 * as the SMP case.
+	 */
+	spinlock_enter();
 	if (setup_func != NULL)
 		setup_func(arg);
 	if (action_func != NULL)
 		action_func(arg);
 	if (teardown_func != NULL)
 		teardown_func(arg);
+	spinlock_exit();
 }
 
 void
@@ -681,12 +690,15 @@ smp_rendezvous(void (*setup_func)(void *
 	       void *arg)
 {
 
+	/* Look comments in the smp_rendezvous_cpus() case. */
+	spinlock_enter();
 	if (setup_func != NULL)
 		setup_func(arg);
 	if (action_func != NULL)
 		action_func(arg);
 	if (teardown_func != NULL)
 		teardown_func(arg);
+	spinlock_exit();
 }
 
 /*


More information about the svn-src-all mailing list