Date: Tue, 7 Dec 2010 09:19:47 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r216251 - in head/sys/cddl/dev/dtrace: amd64 i386 Message-ID: <201012070919.oB79JlkI060659@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012070919.oB79JlkI060659>