From patchwork Tue Feb 17 10:49:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 44740 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4A81E21557 for ; Tue, 17 Feb 2015 10:49:51 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id c41sf14926991eek.1 for ; Tue, 17 Feb 2015 02:49:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id: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=NLn8W8tUcfDCdkWJ+7+E5XSlrXV5lAzdI15Z9Ts/gc4=; b=MCHODr9DLT2qNcdsbNo2a8/W3WgCcvxzfjrCKiQ3U0mPRT95tQaL9ID3CKRN994EQI EyWUD4ppgJ6Q7/oO5SMdLiCm4qAvr8+Ude6SQYSCduL5bTdovSswRIrx9HlMHFKRHWSO WHsN4F/LcZBmgnHTETit27UYwBLKgF78V3iPTpOzte0O6V4U+wK4la5cGUJcIU8d64QX NwIn9BmPnfYeHPAdNTrslZP/NdeD1cgUY3XD7OetV29E5q7b5NhEQ2TxB5goovXqYlr4 J5R9r6yMO3pgu9rCtSwmJ4g/97BtlRVxWle8wR3xARZGlqWNhGBOSTp0ccqCsS8D5JwY DAJg== X-Gm-Message-State: ALoCoQnmFjx14lKzZInTtSCVubTkH3/r12BOWFLPlJQMOQlgmSGs2fXN3oncxCpqfe+nSPKTO/DV X-Received: by 10.112.64.171 with SMTP id p11mr3470689lbs.12.1424170190538; Tue, 17 Feb 2015 02:49:50 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.70 with SMTP id be6ls665593lab.41.gmail; Tue, 17 Feb 2015 02:49:50 -0800 (PST) X-Received: by 10.152.22.129 with SMTP id d1mr3060670laf.22.1424170190391; Tue, 17 Feb 2015 02:49:50 -0800 (PST) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id cj8si3558939lad.106.2015.02.17.02.49.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Feb 2015 02:49:49 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbiz11 with SMTP id z11so3683723lbi.5 for ; Tue, 17 Feb 2015 02:49:49 -0800 (PST) X-Received: by 10.152.6.195 with SMTP id d3mr27846937laa.36.1424170189778; Tue, 17 Feb 2015 02:49:49 -0800 (PST) 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.35.133 with SMTP id h5csp2126312lbj; Tue, 17 Feb 2015 02:49:49 -0800 (PST) X-Received: by 10.140.90.81 with SMTP id w75mr38905qgd.57.1424170188300; Tue, 17 Feb 2015 02:49:48 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id 83si9110796qhq.112.2015.02.17.02.49.47 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Feb 2015 02:49:48 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YNfiq-00016i-UB; Tue, 17 Feb 2015 10:49:44 +0000 Received: from mail-qa0-f47.google.com ([209.85.216.47]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YNfil-00014h-M6 for lng-odp@lists.linaro.org; Tue, 17 Feb 2015 10:49:39 +0000 Received: by mail-qa0-f47.google.com with SMTP id v10so25855838qac.6 for ; Tue, 17 Feb 2015 02:49:34 -0800 (PST) X-Received: by 10.140.19.237 with SMTP id 100mr41044qgh.24.1424170174453; Tue, 17 Feb 2015 02:49:34 -0800 (PST) Received: from mcpro03.emea.nsn-net.net (ec2-23-23-178-99.compute-1.amazonaws.com. [23.23.178.99]) by mx.google.com with ESMTPSA id k3sm15729474qao.0.2015.02.17.02.49.32 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Feb 2015 02:49:33 -0800 (PST) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Tue, 17 Feb 2015 12:49:17 +0200 Message-Id: <1424170157-5375-1-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.3.0 X-Topics: patch Subject: [lng-odp] [PATCH 1/2] api: scheduler: atomic and ordered definitions X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 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-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: petri.savolainen@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.171 as permitted sender) smtp.mail=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 Improved documentation and definition of atomic and ordered queue synchronisation. Signed-off-by: Petri Savolainen --- This is the ordered queue definition (in patch format) promised in the call yesterday. --- include/odp/api/queue.h | 21 +++++++++++++++++++-- include/odp/api/schedule.h | 15 ++++++++++++--- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/include/odp/api/queue.h b/include/odp/api/queue.h index 9519edf..1d67a3c 100644 --- a/include/odp/api/queue.h +++ b/include/odp/api/queue.h @@ -108,12 +108,29 @@ extern "C" { /** * @def ODP_SCHED_SYNC_ATOMIC - * Atomic queue + * Atomic queue synchronisation + * + * Events from an atomic queue can be scheduled only to a single thread at a + * time. This quarantees atomic access to the queue context and maintains event + * ordering, which helps the user to avoid SW locking. + * + * The atomic queue is dedicated to the thread until it requests another event + * from the scheduler (implicitly requests to release the current queue) or + * calls odp_schedule_release_atomic(), which hints the scheduler to release the + * queue early. */ /** * @def ODP_SCHED_SYNC_ORDERED - * Ordered queue + * Ordered queue synchronisation + * + * Events from an ordered queue can be scheduled to multiple threads for + * parallel processing. The original enqueue order of the source queue is + * maintained when events are enqueued to their destination queue(s) before + * another schedule call. Events from the same (source) queue appear in their + * original order when dequeued from a destination queue. The destination + * queue type (POLL/SCHED) or synchronisation (NONE/ATOMIC/ORDERED) is not + * limited. */ /** diff --git a/include/odp/api/schedule.h b/include/odp/api/schedule.h index 5c08357..378ca19 100644 --- a/include/odp/api/schedule.h +++ b/include/odp/api/schedule.h @@ -93,9 +93,9 @@ int odp_schedule_multi(odp_queue_t *from, uint64_t wait, odp_event_t events[], * Pause scheduling * * Pause global scheduling for this thread. After this call, all schedule calls - * will return only locally reserved buffers (if any). User can exit the + * will return only locally reserved events (if any). User can exit the * schedule loop only after the schedule function indicates that there's no more - * buffers (no more locally reserved buffers). + * events (no more locally reserved events). * * Must be used with odp_schedule() and odp_schedule_multi() before exiting (or * stalling) the schedule loop. @@ -111,7 +111,16 @@ void odp_schedule_pause(void); void odp_schedule_resume(void); /** - * Release currently hold atomic context + * Release the current atomic context + * + * This call is valid only for source queues with atomic synchronisation. It + * hints the scheduler that the user has completed processing of the critical + * section (which depends on the atomic synchronisation). The scheduler is now + * allowed to schedule another event(s) from the same queue to another thread. + * + * Early atomic context release may increase parallelism and thus system + * performance, but user needs to design carefully the split into critical vs. + * non-critical sections. */ void odp_schedule_release_atomic(void);