From patchwork Thu Sep 10 16:18:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 53387 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id 7B61422B19 for ; Thu, 10 Sep 2015 16:19:35 +0000 (UTC) Received: by wicuu12 with SMTP id uu12sf9237750wic.2 for ; Thu, 10 Sep 2015 09:19:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=QRqwz6u468yTQCb3FRN5tIq4pWKYZVDl69AxIjcFUaQ=; b=P+omOz/cJGKD0CtdTaksdQtGujq1EViFL03jZSBKpBNnIngY8NesiusDCTVHel5JyT g3+HgGWYc08EIgtiTWiQZRmp81xy8zsQQskAJzbjPWf/n4zMhuZ96HMBPWa7wL49mnFO f8NVpmlAxBRruDGiPafMT5lEuppUHOLtqYPSgU9s9r308C8o2qghdbbLWX13sB3o9j3F oYnPQyecjgEuO7IDrwDUWsnE80TsZArQZYDTYShGlpicSf7FQ8xlTyUiXlIiHyhEGUBG yBMoe/AifBzku+VV2ylNSOfAlYd1oP3U8CORjBOVIXFLC8Wx3KIKBOHW2e2SL6idF+jO tsZQ== X-Gm-Message-State: ALoCoQl5LN0ptDHBf7iNGlopcO8gmhmn0UA3zev6xwExWT94XglQ6SFBDt+4seSUKu0ZQZHXK1Wi X-Received: by 10.112.57.194 with SMTP id k2mr9943932lbq.10.1441901974763; Thu, 10 Sep 2015 09:19:34 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.132 with SMTP id q4ls80597laj.77.gmail; Thu, 10 Sep 2015 09:19:34 -0700 (PDT) X-Received: by 10.152.5.71 with SMTP id q7mr1570922laq.92.1441901974475; Thu, 10 Sep 2015 09:19:34 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id wx8si10881182lbb.69.2015.09.10.09.19.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Sep 2015 09:19:34 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by lbbmp1 with SMTP id mp1so26084205lbb.1 for ; Thu, 10 Sep 2015 09:19:34 -0700 (PDT) X-Received: by 10.112.72.97 with SMTP id c1mr23117206lbv.86.1441901974369; Thu, 10 Sep 2015 09:19:34 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1072328lbq; Thu, 10 Sep 2015 09:19:33 -0700 (PDT) X-Received: by 10.55.18.24 with SMTP id c24mr22315581qkh.109.1441901973063; Thu, 10 Sep 2015 09:19:33 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 35si13828125qgt.128.2015.09.10.09.19.32; Thu, 10 Sep 2015 09:19:33 -0700 (PDT) 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; Received: by lists.linaro.org (Postfix, from userid 109) id 20E9A61CD3; Thu, 10 Sep 2015 16:19:32 +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.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 9249161E50; Thu, 10 Sep 2015 16:19:09 +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 BD78161D84; Thu, 10 Sep 2015 16:19:05 +0000 (UTC) Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by lists.linaro.org (Postfix) with ESMTPS id E624B619C5 for ; Thu, 10 Sep 2015 16:19:00 +0000 (UTC) Received: by wicfx3 with SMTP id fx3so34451011wic.1 for ; Thu, 10 Sep 2015 09:19:00 -0700 (PDT) X-Received: by 10.194.109.97 with SMTP id hr1mr71933814wjb.38.1441901940192; Thu, 10 Sep 2015 09:19:00 -0700 (PDT) Received: from khorivan.synapse.com ([195.238.92.128]) by smtp.gmail.com with ESMTPSA id us6sm6081321wjc.35.2015.09.10.09.18.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Sep 2015 09:18:59 -0700 (PDT) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org, petri.savolainen@nokia.com, nmorey@kalray.eu Date: Thu, 10 Sep 2015 19:18:49 +0300 Message-Id: <1441901930-29287-2-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1441901930-29287-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1441901930-29287-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v2 1/2] linux-generic: odp_schedule: fix odp_schdule_wait_time X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ivan.khoronzhuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Depending on resolution, a low nsec value could be converted to 0 cycles, wich was specified as ODP_SCHED_WAIT and would instruct a schedule call to wait forever. Also ODP_SCHED_NO_WAIT corresponds to 1 tick, it's rarely but can wait a little, when shced time has slower rate. It should correspond to schedule only once. So, change ODP_SCHED_NO_WAIT to 0 and ODP_SCHED_NO_WAIT to UINT64_MAX. Signed-off-by: Ivan Khoronzhuk Reviewed-by: Petri Savolainen --- platform/linux-generic/include/odp/plat/schedule_types.h | 4 ++-- platform/linux-generic/odp_schedule.c | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/platform/linux-generic/include/odp/plat/schedule_types.h b/platform/linux-generic/include/odp/plat/schedule_types.h index c48b652..8cdc40b 100644 --- a/platform/linux-generic/include/odp/plat/schedule_types.h +++ b/platform/linux-generic/include/odp/plat/schedule_types.h @@ -22,8 +22,8 @@ extern "C" { * @{ */ -#define ODP_SCHED_WAIT 0 -#define ODP_SCHED_NO_WAIT 1 +#define ODP_SCHED_WAIT UINT64_MAX +#define ODP_SCHED_NO_WAIT 0 typedef int odp_schedule_prio_t; diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index c6619e5..827fcf0 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -646,9 +646,6 @@ void odp_schedule_resume(void) uint64_t odp_schedule_wait_time(uint64_t ns) { - if (ns <= ODP_SCHED_NO_WAIT) - ns = ODP_SCHED_NO_WAIT + 1; - return odp_time_ns_to_cycles(ns); }