svn commit: r219494 - in stable/8/sys/cddl/dev/dtrace: amd64 i386
Andriy Gapon
avg at FreeBSD.org
Fri Mar 11 15:38:43 UTC 2011
Author: avg
Date: Fri Mar 11 15:38:42 2011
New Revision: 219494
URL: http://svn.freebsd.org/changeset/base/219494
Log:
MFC r216250: dtrace_gethrtime_init: pin to master while examining other CPUs
Modified:
stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.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/cddl/dev/dtrace/amd64/dtrace_subr.c
==============================================================================
--- stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Fri Mar 11 15:34:06 2011 (r219493)
+++ stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Fri Mar 11 15:38:42 2011 (r219494)
@@ -405,6 +405,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 +438,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 +453,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);
Modified: stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c
==============================================================================
--- stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c Fri Mar 11 15:34:06 2011 (r219493)
+++ stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c Fri Mar 11 15:38:42 2011 (r219494)
@@ -405,6 +405,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 +438,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 +453,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);
More information about the svn-src-stable-8
mailing list