From 069610c72203fafa99edef9980b836ef1df47760 Mon Sep 17 00:00:00 2001 From: attilio Date: Wed, 23 Nov 2011 15:41:55 +0000 Subject: [PATCH] MFC r227058: Disable interrupt and preemption for smp_rendezvous() also in the UP/!SMP case. Sponsored by: Sandvine Incorporated Approved by: re (kib) git-svn-id: svn://svn.freebsd.org/base/releng/9.0@227889 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/kern/subr_smp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index 87d536c4..dba82cf2 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -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(); } /* -- 2.42.0