From patchwork Tue Aug 25 00:14:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 52657 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id 3B51D22DD4 for ; Tue, 25 Aug 2015 00:17:56 +0000 (UTC) Received: by labia3 with SMTP id ia3sf21194059lab.3 for ; Mon, 24 Aug 2015 17:17:55 -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=7Ox01ybQaMNf7idNmkyHtPc58aWQ2N094Q93bc4v+F8=; b=Gu0oqI2WnmyxjyIVdyerdJrKFJhOHISEd1Y6Dh8ZEXZ06yAHySrlcg0fi3s3ZYH0NO BemQG+3eGPldH3K2r36bhL7XnsbG9BYG2qpadyX88puHF8Odk58t4fu68ta9HzOlcNxK qS5caUbee+REHpmYsHZj8qno+Vo98IES9bZU/VozLkaG8eJHOSAoT/VECjOqG7+/LhJY cY/e7VCTUxIIsN5WLJpeTUqEsp5Poien1rO9u1LzR9BKpipnL5RoNUrB6aP9We+AF1zH mhB5STHLbGwkjcAHsIqwlXd6IY7LTqT+dwPJMlVMPM48wTIJ1qtQBoHje+IXeZkGjLOw XQHw== X-Gm-Message-State: ALoCoQlFEHQQgAAYg3emZAWPk5uZJH22BhJEBdmZx5/y1X2+M4JwzECdI3B56+4nd/58acq55aQH X-Received: by 10.112.172.70 with SMTP id ba6mr7521448lbc.1.1440461875142; Mon, 24 Aug 2015 17:17:55 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.10.33 with SMTP id f1ls726857lab.49.gmail; Mon, 24 Aug 2015 17:17:55 -0700 (PDT) X-Received: by 10.112.169.97 with SMTP id ad1mr22928555lbc.90.1440461874995; Mon, 24 Aug 2015 17:17:54 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id mr8si14622844lbb.104.2015.08.24.17.17.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Aug 2015 17:17:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by laba3 with SMTP id a3so88138739lab.1 for ; Mon, 24 Aug 2015 17:17:54 -0700 (PDT) X-Received: by 10.152.44.196 with SMTP id g4mr23213301lam.56.1440461874871; Mon, 24 Aug 2015 17:17:54 -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.162.200 with SMTP id yc8csp2812035lbb; Mon, 24 Aug 2015 17:17:53 -0700 (PDT) X-Received: by 10.50.43.197 with SMTP id y5mr18104959igl.89.1440461872737; Mon, 24 Aug 2015 17:17:52 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id g99si8678432iod.173.2015.08.24.17.17.50; Mon, 24 Aug 2015 17:17:52 -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 C353961F18; Tue, 25 Aug 2015 00:17:50 +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 84E3C61F2C; Tue, 25 Aug 2015 00:14:55 +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 AB9F661F17; Tue, 25 Aug 2015 00:14:43 +0000 (UTC) Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com [209.85.214.177]) by lists.linaro.org (Postfix) with ESMTPS id D912361F01 for ; Tue, 25 Aug 2015 00:14:40 +0000 (UTC) Received: by obbfr1 with SMTP id fr1so128233453obb.1 for ; Mon, 24 Aug 2015 17:14:40 -0700 (PDT) X-Received: by 10.60.80.229 with SMTP id u5mr24895358oex.27.1440461680249; Mon, 24 Aug 2015 17:14:40 -0700 (PDT) Received: from Ubuntu15.localdomain (cpe-24-28-70-239.austin.res.rr.com. [24.28.70.239]) by smtp.gmail.com with ESMTPSA id p10sm11084442oev.0.2015.08.24.17.14.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Aug 2015 17:14:39 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Mon, 24 Aug 2015 19:14:23 -0500 Message-Id: <1440461669-18578-6-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1440461669-18578-1-git-send-email-bill.fischofer@linaro.org> References: <1440461669-18578-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv2 05/11] api: schedule: add ordered locks 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: bill.fischofer@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.215.48 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 Add the following APIs to support ordered locks: odp_schedule_order_lock() odp_schedule_order_unlock() Signed-off-by: Bill Fischofer --- include/odp/api/schedule.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/include/odp/api/schedule.h b/include/odp/api/schedule.h index 5837f69..8011583 100644 --- a/include/odp/api/schedule.h +++ b/include/odp/api/schedule.h @@ -164,6 +164,32 @@ void odp_schedule_release_atomic(void); void odp_schedule_release_ordered(void); /** + * Ordered context lock + * + * Provide reusable in-order serialization for scheduled ordered + * contexts. Upon return the caller is in order with respect to other events + * originating from the current ordered context and will retain order until a + * subsequent odp_schedule_order_unlock() call is made, or until order is + * resolved for the event via a call to odp_queue_enq() or + * odp_schedule_release_ordered(). This call is a no-op if the caller is not + * operating in an ordered context. + */ +void odp_schedule_order_lock(void); + +/** + * Ordered context unlock + * + * Release an ordered context lock previously acquired by + * odp_schedule_order_lock(). Following this call, the thread will exit the + * critical section protected by the ordered lock and will resume parallel + * execution until the next call to odp_schedule_order_lock(), or until order + * is resolved by a call to odp_queue_enq() or + * odp_schedule_release_ordered(). Note that this API is a no-op does if not + * called in an ordered context. + */ +void odp_schedule_order_unlock(void); + +/** * Prefetch events for next schedule call * * Hint the scheduler that application is about to finish processing the current