From patchwork Tue Nov 10 15:35:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 56338 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp841594lbb; Tue, 10 Nov 2015 07:39:57 -0800 (PST) X-Received: by 10.50.30.101 with SMTP id r5mr4644731igh.35.1447169997737; Tue, 10 Nov 2015 07:39:57 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 64si5422611iol.79.2015.11.10.07.39.57; Tue, 10 Nov 2015 07:39:57 -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 0A2EF61946; Tue, 10 Nov 2015 15:39:57 +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 A776A61D1D; Tue, 10 Nov 2015 15:38:18 +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 0A28361D25; Tue, 10 Nov 2015 15:38:16 +0000 (UTC) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com [209.85.217.173]) by lists.linaro.org (Postfix) with ESMTPS id 8C8EB6196C for ; Tue, 10 Nov 2015 15:36:12 +0000 (UTC) Received: by lbblt2 with SMTP id lt2so102581lbb.3 for ; Tue, 10 Nov 2015 07:36:11 -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=cfLAiDPgPJ6KVFJ/4I7g/pN41a248u/NRwjHyE7GisGvR7pN1sq7zptlNIeZQ3INfB VK7/9LKRrMsBu9CyfEUNM14cGYixNJ/iiEgxVAErmCohLNDAS0Mxz+a75URrK6UCfuWi 5yVZVkm2g52qY36qTicurmYFSJwpxOszr8WOp7iU5AIBRBgRRoxs8vQ6akjXr6zqFwuy Y4A6au9iucAMgaBIv5JPlj7OzNfVpDO/me8Y0T/AxE4Y6WmjE/HW7+ITENKbCX40bfKr Nl0wUbzCER990JHhj/RUABzJ1P9cyBcEthFe4NA6hVkijN6raA/CVbWZN4ypwYcQquvu JwiQ== 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=P0w5ebPJyPAy9h5D1g7kVV5LXlFOyb42vDVstsfYAe3r5vK9FoF5e3bBzGWqRBtSr2 KZoxz4K/DYVnVHPXPDQPDM4Um+tyC/SasfwMAw4mDLjDQGV2St2h8nqRNLsyMDxtl+fm fIRFDcGUd4dehS4sfnj8pZl3Mr1VDeSeB4m5wqn9wZzx9UeCs/q8dWpkIwV2+Y7dWsUA HuAANu0wKKTQu8fsGx4Dt6QtdZnIhJo/ZIImuTrcAT2fYpDUwgzG0sjwetQhchCRtIz1 T4iRsxq7j1B1zAoW/APgNAt2dx4ZjoQvhiPZs5JDjdPLVTgJo1VBKDGNiBBIj3nSIFJs hEug== X-Gm-Message-State: ALoCoQllOX49XXzxF2wXTyrxqBWx2QP904nGlI9CeDZqk9g5f6zPZH5SYNQv6FJY0AMkXgV34mme X-Received: by 10.112.141.201 with SMTP id rq9mr2081954lbb.4.1447169771325; Tue, 10 Nov 2015 07:36:11 -0800 (PST) Received: from localhost.localdomain ([195.238.92.128]) by smtp.gmail.com with ESMTPSA id h37sm625049lfi.8.2015.11.10.07.36.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Nov 2015 07:36:10 -0800 (PST) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Tue, 10 Nov 2015 17:35:59 +0200 Message-Id: <1447169760-15258-3-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447169760-15258-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1447169760-15258-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: timers patch Subject: [lng-odp] [PATCH 2/3 v5] 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 --- 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;