Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 07 May 2011 12:42:48 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        current@FreeBSD.org
Subject:   pls review: remove dtrace_gethrtime_init_sync
Message-ID:  <4DC51418.40604@FreeBSD.org>

next in thread | raw e-mail | index | archive | help

I couldn't think of any purpose for the code under CHECK_SYNC.
So I'd like to just drop it.

    dtrace_gethrtime_init: remove some useless code

diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
index a44334a..f59fad3 100644
--- a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
+++ b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
@@ -359,26 +359,6 @@ static uint32_t	nsec_scale;
 #define SCALE_SHIFT	28

 static void
-dtrace_gethrtime_init_sync(void *arg)
-{
-#ifdef CHECK_SYNC
-	/*
-	 * Delay this function from returning on one
-	 * of the CPUs to check that the synchronisation
-	 * works.
-	 */
-	uintptr_t cpu = (uintptr_t) arg;
-
-	if (cpu == curcpu) {
-		int i;
-		for (i = 0; i < 1000000000; i++)
-			tgt_cpu_tsc = rdtsc();
-		tgt_cpu_tsc = 0;
-	}
-#endif
-}
-
-static void
 dtrace_gethrtime_init_cpu(void *arg)
 {
 	uintptr_t cpu = (uintptr_t) arg;
@@ -434,7 +414,7 @@ dtrace_gethrtime_init(void *arg)
 		pc = pcpu_find(i);
 		map = PCPU_GET(cpumask) | pc->pc_cpumask;

-		smp_rendezvous_cpus(map, dtrace_gethrtime_init_sync,
+		smp_rendezvous_cpus(map, NULL,
 		    dtrace_gethrtime_init_cpu,
 		    smp_no_rendevous_barrier, (void *)(uintptr_t) i);

diff --git a/sys/cddl/dev/dtrace/i386/dtrace_subr.c
b/sys/cddl/dev/dtrace/i386/dtrace_subr.c
index 2ef21f8..d4177a4 100644
--- a/sys/cddl/dev/dtrace/i386/dtrace_subr.c
+++ b/sys/cddl/dev/dtrace/i386/dtrace_subr.c
@@ -359,26 +359,6 @@ static uint32_t	nsec_scale;
 #define SCALE_SHIFT	28

 static void
-dtrace_gethrtime_init_sync(void *arg)
-{
-#ifdef CHECK_SYNC
-	/*
-	 * Delay this function from returning on one
-	 * of the CPUs to check that the synchronisation
-	 * works.
-	 */
-	uintptr_t cpu = (uintptr_t) arg;
-
-	if (cpu == curcpu) {
-		int i;
-		for (i = 0; i < 1000000000; i++)
-			tgt_cpu_tsc = rdtsc();
-		tgt_cpu_tsc = 0;
-	}
-#endif
-}
-
-static void
 dtrace_gethrtime_init_cpu(void *arg)
 {
 	uintptr_t cpu = (uintptr_t) arg;
@@ -434,7 +414,7 @@ dtrace_gethrtime_init(void *arg)
 		pc = pcpu_find(i);
 		map = PCPU_GET(cpumask) | pc->pc_cpumask;

-		smp_rendezvous_cpus(map, dtrace_gethrtime_init_sync,
+		smp_rendezvous_cpus(map, NULL,
 		    dtrace_gethrtime_init_cpu,
 		    smp_no_rendevous_barrier, (void *)(uintptr_t) i);


-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4DC51418.40604>