From patchwork Thu Nov 19 14:30:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 56999 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp3215376lbb; Thu, 19 Nov 2015 06:32:03 -0800 (PST) X-Received: by 10.55.203.151 with SMTP id u23mr7057791qkl.84.1447943523563; Thu, 19 Nov 2015 06:32:03 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id g131si6895835qkb.102.2015.11.19.06.32.02; Thu, 19 Nov 2015 06:32:03 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: by lists.linaro.org (Postfix, from userid 109) id D5DD661A41; Thu, 19 Nov 2015 14:32:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 10C0261B3F; Thu, 19 Nov 2015 14:30:33 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id AD14461A55; Thu, 19 Nov 2015 14:30:20 +0000 (UTC) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) by lists.linaro.org (Postfix) with ESMTPS id D2B9761A23 for ; Thu, 19 Nov 2015 14:30:14 +0000 (UTC) Received: by lbbkw15 with SMTP id kw15so44626072lbb.0 for ; Thu, 19 Nov 2015 06:30:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ORKdw638G6Jd/sgZqIPLZYzNEft/9AxQZCPTqWPkE78=; b=tedwCFxeuiIEJYM9P0+99lEMqItgYiSMprQa0DOj6XKYpcS3LFwbScXW5WztTaPBcD dnkCL+mWSffR51kYeuBtaRjtevlzGtpRnCijvzljWs3HNhby3xMKUpx2bZpCySyireeU +xjxjSgUdv0S28hS2YzjY2JmPi9HkCDBjW3owetm9/uK9RyJwXXY2G2IjJ4nZ+mZr6Ds npLtBGwixx52GskmKLSMs4V//Y6RtcQMaBhdJJKwnrWTq2ssnSK3VnhnMpxCgdxxDTSU S7ly/X6ZKq/gB+6IcE3fUV3PXVjH0yIMRdcPLBAs7Cv5aZvjGPvxhEGwyMjivPh9K2zD 1Szw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ORKdw638G6Jd/sgZqIPLZYzNEft/9AxQZCPTqWPkE78=; b=e6zKhe7fC9DCK1I7nIGB59RXqtEEGX0XyJCRd5LqanD8RnQyyW/8TwPaWOqexxt1vi p9yyZm9H0MT9qZ5SU2fMnATEgWL2rwTCDDuV59a1EO2+PNeF+4Wscr0Dzv7kHddDER7b b4UQNTuJRtiPhjWR1VIrlCh/bu12/lZYAY8BjrReZshqhBhRBjyElg5fOE8vf+eN2VQD enIdmHisWMPxK7fu2HXp+GkNgJGCbr/Dldd/TqFBhkdV/zsXhM/0m30nKDCkxlQaphcb 4mij00U8Ex652KhddztaiqST0HSeShDNV2sZmrGIc3NSjHwk5eO8oVW/dFx9DK5W7mwL Am0w== X-Gm-Message-State: ALoCoQmk0zl/SySXZvtHWYh/qFHwkLPzUzFedH+fsQDC8vViLzvWPJb38a7pf75XP0e+fJcpTo/U X-Received: by 10.112.126.70 with SMTP id mw6mr3425768lbb.81.1447943413529; Thu, 19 Nov 2015 06:30:13 -0800 (PST) Received: from localhost.localdomain ([195.238.92.128]) by smtp.gmail.com with ESMTPSA id f71sm535235lfe.36.2015.11.19.06.30.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Nov 2015 06:30:12 -0800 (PST) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Thu, 19 Nov 2015 16:30:02 +0200 Message-Id: <1447943403-24803-3-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447943403-24803-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1447943403-24803-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: timers patch Subject: [lng-odp] [PATCH v6 2/3] linux-generic: odp_timer: warn if tick is late X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" If tick is late then application should be warned about this. It means that actual timer resolution is worse than expected. The default timer resolution is set 10ms, that is equal to jiffy on most systems. The default resolution is set bearing in mind that on a CPU runs maximum two threads that ideally fits in 10ms. But user can change it to be smaller, in case if CPU0 is isolated and it handles only the timer ticks. This patch helps user to set correct timer resolution. Signed-off-by: Ivan Khoronzhuk Reviewed-by: Ola Liljedahl --- platform/linux-generic/odp_timer.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index e8f0267..407ccc1 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -632,7 +632,14 @@ static unsigned odp_timer_pool_expire(odp_timer_pool_t tpid, uint64_t tick) static void timer_notify(sigval_t sigval) { + int overrun; odp_timer_pool *tp = (odp_timer_pool *)sigval.sival_ptr; + + overrun = timer_getoverrun(tp->timerid); + if (overrun) + ODP_ERR("\n\t%d ticks overrun on timer pool \"%s\", timer resolution too high\n", + overrun, tp->name); + #ifdef __ARM_ARCH odp_timer *array = &tp->timers[0]; uint32_t i;