Author: attilio
Date: Wed Nov 23 16:02:36 2011
New Revision: 227891
URL: http://svn.freebsd.org/changeset/base/227891

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

Modified:
  stable/8/sys/kern/subr_smp.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/kern/subr_smp.c
==============================================================================
--- stable/8/sys/kern/subr_smp.c        Wed Nov 23 16:02:12 2011        
(r227890)
+++ stable/8/sys/kern/subr_smp.c        Wed Nov 23 16:02:36 2011        
(r227891)
@@ -409,13 +409,16 @@ smp_rendezvous_cpus(cpumask_t map,
 {
        int 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;
        }
 
@@ -652,12 +655,18 @@ smp_rendezvous_cpus(cpumask_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
@@ -667,12 +676,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();
 }
 
 /*
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to