Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933150AbbFIMYv (ORCPT ); Tue, 9 Jun 2015 08:24:51 -0400 Received: from smtprelay2.synopsys.com ([198.182.60.111]:33661 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753976AbbFIMYm (ORCPT ); Tue, 9 Jun 2015 08:24:42 -0400 From: Vineet Gupta To: , CC: , Alexey Brodkin , , Peter Zijlstra , Arnaldo Carvalho de Melo , Vineet Gupta Subject: [PATCH 5/8] ARCv2: perf: set usable max period as a half of real max period Date: Tue, 9 Jun 2015 17:49:29 +0530 Message-ID: <1433852372-29494-6-git-send-email-vgupta@synopsys.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1433852372-29494-1-git-send-email-vgupta@synopsys.com> References: <1433852372-29494-1-git-send-email-vgupta@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.12.197.3] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1440 Lines: 38 From: Alexey Brodkin Overflow interrupt happens when counter reaches a limit which we set as a maximum value of the counter. But for better precision counter continues registration of assigned events even after reaching pre-defined limit. To not really overlap we leave half of the counter values free. Cc: Peter Zijlstra Cc: Arnaldo Carvalho de Melo Signed-off-by: Alexey Brodkin Signed-off-by: Vineet Gupta --- arch/arc/kernel/perf_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arc/kernel/perf_event.c b/arch/arc/kernel/perf_event.c index 4e3211948467..a7b4e4826533 100644 --- a/arch/arc/kernel/perf_event.c +++ b/arch/arc/kernel/perf_event.c @@ -491,7 +491,7 @@ static int arc_pmu_device_probe(struct platform_device *pdev) arc_pmu->n_counters = pct_bcr.c; counter_size = 32 + (pct_bcr.s << 4); - arc_pmu->max_period = (1ULL << counter_size) - 1ULL; + arc_pmu->max_period = (1ULL << counter_size) / 2 - 1ULL; pr_info("ARC perf\t: %d counters (%d bits), %d conditions%s\n", arc_pmu->n_counters, counter_size, cc_bcr.c, -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/