From owner-freebsd-current@FreeBSD.ORG Sat May 7 09:42:51 2011 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C56AF106566B for ; Sat, 7 May 2011 09:42:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 178658FC0A for ; Sat, 7 May 2011 09:42:50 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA05968 for ; Sat, 07 May 2011 12:42:49 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1QIe2D-0004BJ-5d for current@FreeBSD.org; Sat, 07 May 2011 12:42:49 +0300 Message-ID: <4DC51418.40604@FreeBSD.org> Date: Sat, 07 May 2011 12:42:48 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110503 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: current@FreeBSD.org X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=X-VIET-VPS Content-Transfer-Encoding: 7bit Cc: Subject: pls review: remove dtrace_gethrtime_init_sync X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2011 09:42:51 -0000 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