diff options
author | dim <dim@FreeBSD.org> | 2010-12-09 22:01:15 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2010-12-09 22:01:15 +0000 |
commit | a3786f65f1e2fa3a4e925fdb4b2b5544b9021bf9 (patch) | |
tree | 5f0a24f71baa3176c75a20a51a9e20a22c75426c /sys/cddl/dev/dtrace/amd64/dtrace_subr.c | |
parent | ad01c620333d05c430d583ee40647e396be1ab91 (diff) | |
parent | 12dd9eb8e940c48f9fc30dbc137071b4fe5caead (diff) | |
download | FreeBSD-src-a3786f65f1e2fa3a4e925fdb4b2b5544b9021bf9.zip FreeBSD-src-a3786f65f1e2fa3a4e925fdb4b2b5544b9021bf9.tar.gz |
Sync: merge r216133 through r216338 from ^/head.
Diffstat (limited to 'sys/cddl/dev/dtrace/amd64/dtrace_subr.c')
-rw-r--r-- | sys/cddl/dev/dtrace/amd64/dtrace_subr.c | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c index b4c7eaf..f86f535 100644 --- a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c @@ -115,26 +115,13 @@ dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) { 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 @@ -405,6 +392,7 @@ dtrace_gethrtime_init_cpu(void *arg) static void dtrace_gethrtime_init(void *arg) { + struct pcpu *pc; uint64_t tsc_f; cpumask_t map; int i; @@ -437,15 +425,14 @@ dtrace_gethrtime_init(void *arg) nsec_scale = ((uint64_t)NANOSEC << SCALE_SHIFT) / tsc_f; /* The current CPU is the reference one. */ + sched_pin(); tsc_skew[curcpu] = 0; - CPU_FOREACH(i) { if (i == curcpu) continue; - map = 0; - map |= (1 << curcpu); - map |= (1 << i); + pc = pcpu_find(i); + map = PCPU_GET(cpumask) | pc->pc_cpumask; smp_rendezvous_cpus(map, dtrace_gethrtime_init_sync, dtrace_gethrtime_init_cpu, @@ -453,6 +440,7 @@ dtrace_gethrtime_init(void *arg) tsc_skew[i] = tgt_cpu_tsc - hst_cpu_tsc; } + sched_unpin(); } SYSINIT(dtrace_gethrtime_init, SI_SUB_SMP, SI_ORDER_ANY, dtrace_gethrtime_init, NULL); |