Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp651974imu; Mon, 5 Nov 2018 06:50:42 -0800 (PST) X-Google-Smtp-Source: AJdET5dRW495kVHVEnBwHMYAlCxoU8ccTlQ8JBm7CRP7gDnGD38T1ByOVfL747kZByrLIzEdx2gq X-Received: by 2002:a63:ed09:: with SMTP id d9-v6mr20166084pgi.305.1541429442006; Mon, 05 Nov 2018 06:50:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541429441; cv=none; d=google.com; s=arc-20160816; b=xxyrBnDhp9XCgAxhXSziXK2o6onXxxasW2XPekCuTO3E9uASQ5BPOwCjvxImFYdSvn i9G0PR+yxTTluRYgp2rdvjdV17QfddojqUbWvko+t+q6zR0FfICBlYwL3IEMfUQOqujZ Ic+IokmWFIYB77Y8Iq2tG1ssaWI21E80LuhHzPdiUafmYXFJl6AsHeg1YJ8fowoo5Deb a2ojUMWBuHuOgg1iwMwEpchGvVRTuVWb5+NiULqKAINDSJJl0SklGMs/JrfIUYWsYRTq iUxuBu9HTDGsY+FvnYuGE7qR7IDmTS/5VJvjiSmzH4qRdnqgATf80gU0gQQ4y1w32VWB flGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=uxeZi1Yhll4H9BRPzXJvyePrMFVAVXamDRBXYsqcxeU=; b=yoI0FEU5QXW/C/Sm7VykBnpc6jNvq6MGwEkBPtcbiqTtBJPloD3t5iGyVpGnBy5y4Y ZKp26UET8CIUwEgPMGnERMU1W0/BULL6MVHb0djm+r8EMQK3jp+HSjKGAnrh2qArvmb9 J3rmg5mFuD/BUz/Buxctyne0lMrqcP6F93tyg0tjl3XYfDv+RDlvsL0EQROFysY6AtGK Wk00YdeKDfXF/+moJK3hT2xHG2wMEuq4yg9QDk5BwONfrnqbXizHGjbz5WtYl9zf6pXp 6QdzjFVdkeWO0z4ropp5Dv+dWzL6xaAn+yCJyZlc5CmoZGy2KcfizrYbjwk6jMa4qX3/ yj/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T4zH+YUS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z7-v6si44244351pgi.178.2018.11.05.06.50.26; Mon, 05 Nov 2018 06:50:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T4zH+YUS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729994AbeKFAI0 (ORCPT + 99 others); Mon, 5 Nov 2018 19:08:26 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:37579 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726255AbeKFAI0 (ORCPT ); Mon, 5 Nov 2018 19:08:26 -0500 Received: by mail-wr1-f67.google.com with SMTP id o15-v6so6187217wrv.4 for ; Mon, 05 Nov 2018 06:48:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=uxeZi1Yhll4H9BRPzXJvyePrMFVAVXamDRBXYsqcxeU=; b=T4zH+YUSxTE3jiJ1BQYwfxvY2N7TX8gva5HqPGIbYzxuejQb4i4DKm15pnISuxn/7M CWQo1qypPrmUI19I6vKkMRVk2WOnWIVb3V7YfZtAcK/hOuYmskjsx5FUH/P6KgIbg9at u687nMlEfnvp8qJ1JohzlQfqJTnJVuHchOXyk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=uxeZi1Yhll4H9BRPzXJvyePrMFVAVXamDRBXYsqcxeU=; b=k+3e6LmXPvipuheVDmopcKIBgmrqYm/DU+g1wFJ6pFBXtsDxc7guaL0SswfI67EbXf f60PIMTTJFAhpOhMDl5kdJRfX5440RhbfNi+uBGmSjwPqq0LtiHgzn5d9qGau6mp+EIH JS6XaUWSR43LjCK/0iCabPaG/IV0b5Ga1Rn6fq1/r/rPs9gtgTd+m9TNJ7ha0FtsUyKw JNTg4fAVQDnXHcwV2CNiQ4dmIxA15o5CDf4QZuUVjkA/RkqxtvgzPhLSFnoTaCQXs4ap WpyyGHXFolk+dplY32vkDDqRsunchLGgB9oLJgaOTMN09q66EiZVHmj81vEDH64VGkaU DZFQ== X-Gm-Message-State: AGRZ1gLIjssakGixTfOM7Hz5J1Mv2u9pXyNNeuRtiSNeK9J+TLa4N5Ug OvyQVdfAfpsB5G8F49f5fqXbIf5eP60= X-Received: by 2002:a5d:62c1:: with SMTP id o1-v6mr15004920wrv.83.1541429300298; Mon, 05 Nov 2018 06:48:20 -0800 (PST) Received: from [192.168.0.40] (119.151.136.77.rev.sfr.net. [77.136.151.119]) by smtp.googlemail.com with ESMTPSA id j203-v6sm37483611wmd.46.2018.11.05.06.48.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 06:48:19 -0800 (PST) Subject: Re: [PATCH v2] clocksource/drivers/arc_timer: Utilize generic sched_clock To: Vineet Gupta , Alexey Brodkin , "linux-kernel@vger.kernel.org" Cc: "linux-snps-arc@lists.infradead.org" , Thomas Gleixner References: <20181017113020.7551-1-abrodkin@synopsys.com> From: Daniel Lezcano Message-ID: <03125734-8c46-8c85-2bb5-64f787ca1f4d@linaro.org> Date: Mon, 5 Nov 2018 15:48:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/10/2018 00:33, Vineet Gupta wrote: > On 10/17/2018 04:30 AM, Alexey Brodkin wrote: >> It turned out we used to use default implementation of sched_clock() >> from kernel/sched/clock.c which was as precise as 1/HZ, i.e. >> by default we had 10 msec granularity of time measurement. >> >> Now given ARC built-in timers are clocked with the same frequency as >> CPU cores we may get much higher precision of time tracking. >> >> Thus we switch to generic sched_clock which really reads ARC hardware >> counters. >> >> This is especially helpful for measuring short events. >> That's what we used to have: >> ------------------------------>8------------------------ >> $ perf stat /bin/sh -c /root/lmbench-master/bin/arc/hello > /dev/null >> >> Performance counter stats for '/bin/sh -c /root/lmbench-master/bin/arc/hello': >> >> 10.000000 task-clock (msec) # 2.832 CPUs utilized >> 1 context-switches # 0.100 K/sec >> 1 cpu-migrations # 0.100 K/sec >> 63 page-faults # 0.006 M/sec >> 3049480 cycles # 0.305 GHz >> 1091259 instructions # 0.36 insn per cycle >> 256828 branches # 25.683 M/sec >> 27026 branch-misses # 10.52% of all branches >> >> 0.003530687 seconds time elapsed >> >> 0.000000000 seconds user >> 0.010000000 seconds sys >> ------------------------------>8------------------------ >> >> And now we'll see: >> ------------------------------>8------------------------ >> $ perf stat /bin/sh -c /root/lmbench-master/bin/arc/hello > /dev/null >> >> Performance counter stats for '/bin/sh -c /root/lmbench-master/bin/arc/hello': >> >> 3.004322 task-clock (msec) # 0.865 CPUs utilized >> 1 context-switches # 0.333 K/sec >> 1 cpu-migrations # 0.333 K/sec >> 63 page-faults # 0.021 M/sec >> 2986734 cycles # 0.994 GHz >> 1087466 instructions # 0.36 insn per cycle >> 255209 branches # 84.947 M/sec >> 26002 branch-misses # 10.19% of all branches >> >> 0.003474829 seconds time elapsed >> >> 0.003519000 seconds user >> 0.000000000 seconds sys >> ------------------------------>8------------------------ >> >> Note how much more meaningful is the second output - time spent for >> execution pretty much matches number of cycles spent (we're running >> @ 1GHz here). >> >> Signed-off-by: Alexey Brodkin >> Cc: Daniel Lezcano >> Cc: Vineet Gupta >> Cc: Thomas Gleixner >> --- > > Acked-by: Vineet Gupta > > @Daniel is this going via timer tree or you want me to pick it up. Applied, thanks -- Daniel -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog