svn commit: r216251 - in head/sys/cddl/dev/dtrace: amd64 i386

Andriy Gapon avg at FreeBSD.org
Tue Dec 7 09:19:47 UTC 2010


Author: avg
Date: Tue Dec  7 09:19:47 2010
New Revision: 216251
URL: http://svn.freebsd.org/changeset/base/216251

Log:
  dtrace_xcall: no need for special handling of curcpu
  
  smp_rendezvous_cpus alreadt does the right thing in a very similar
  fashion, so the code was kind of duplicating that.
  
  MFC after:	3 weeks

Modified:
  head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
  head/sys/cddl/dev/dtrace/i386/dtrace_subr.c

Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
==============================================================================
--- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c	Tue Dec  7 09:03:17 2010	(r216250)
+++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c	Tue Dec  7 09:19:47 2010	(r216251)
@@ -115,26 +115,13 @@ dtrace_xcall(processorid_t cpu, dtrace_x
 {
 	cpumask_t cpus;
 
-	critical_enter();
-
 	if (cpu == DTRACE_CPUALL)
 		cpus = all_cpus;
 	else
-		cpus = (cpumask_t) (1 << cpu);
-
-	/* If the current CPU is in the set, call the function directly: */
-	if ((cpus & (1 << curcpu)) != 0) {
-		(*func)(arg);
-
-		/* Mask the current CPU from the set */
-		cpus &= ~(1 << curcpu);
-	}
-
-	/* If there are any CPUs in the set, cross-call to those CPUs */
-	if (cpus != 0)
-		smp_rendezvous_cpus(cpus, NULL, func, smp_no_rendevous_barrier, arg);
+		cpus = (cpumask_t)1 << cpu;
 
-	critical_exit();
+	smp_rendezvous_cpus(cpus, smp_no_rendevous_barrier, func,
+	    smp_no_rendevous_barrier, arg);
 }
 
 static void

Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
==============================================================================
--- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c	Tue Dec  7 09:03:17 2010	(r216250)
+++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c	Tue Dec  7 09:19:47 2010	(r216251)
@@ -115,26 +115,13 @@ dtrace_xcall(processorid_t cpu, dtrace_x
 {
 	cpumask_t cpus;
 
-	critical_enter();
-
 	if (cpu == DTRACE_CPUALL)
 		cpus = all_cpus;
 	else
-		cpus = (cpumask_t) (1 << cpu);
-
-	/* If the current CPU is in the set, call the function directly: */
-	if ((cpus & (1 << curcpu)) != 0) {
-		(*func)(arg);
-
-		/* Mask the current CPU from the set */
-		cpus &= ~(1 << curcpu);
-	}
-
-	/* If there are any CPUs in the set, cross-call to those CPUs */
-	if (cpus != 0)
-		smp_rendezvous_cpus(cpus, NULL, func, smp_no_rendevous_barrier, arg);
+		cpus = (cpumask_t)1 << cpu;
 
-	critical_exit();
+	smp_rendezvous_cpus(cpus, smp_no_rendevous_barrier, func,
+	    smp_no_rendevous_barrier, arg);
 }
 
 static void


More information about the svn-src-all mailing list