From patchwork Wed Feb 18 13:38:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 44770 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 ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8853A21544 for ; Wed, 18 Feb 2015 13:38:44 +0000 (UTC) Received: by lamq1 with SMTP id q1sf841074lam.0 for ; Wed, 18 Feb 2015 05:38:43 -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=Vfa2VPWJ+sQP2laSnNHJuLsDlXeUQ5vXhPxN7pBOOcA=; b=Ofz+gDetzFvfXUuiI4hhuA8Yw+FdUf/LPJSzlaBKxqIB6wdSX0cmO1KbjX2dZw8Nne ol9T7rxSmy7UgAodqQ4GfBh4XdgGXIpKQ83fQuwN+v5UxMr+VYMf6o2ju4McZKS7XIJH 4bbrNII9jJ5A6fSSbxw0gGh7iZXkfw/3+p7ukeOFmWpPG9PJ1B9fJkNI98NCqvVHk4sE P/aOzGACxAibYrbZfYm/9RzKRPVJ/apeDo7kO4CODLUH2GSKb8WJm8wCOKOj6uUSymWA eCkMEHlt1QxQDoOxPrQ8p1cUE+NbjMkALtgA9iknVhbIG0f6D/g/Eb9v77BzguDqvH9x 0M+A== X-Gm-Message-State: ALoCoQk4NUaAt2G+HQasOTxHukh6fSO00V/JBNmuRJBl4uHO+QKILeZswcNWdxN1O2CBk5vBeYr5 X-Received: by 10.180.13.98 with SMTP id g2mr356130wic.3.1424266723183; Wed, 18 Feb 2015 05:38:43 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.71 with SMTP id k7ls27238laf.9.gmail; Wed, 18 Feb 2015 05:38:43 -0800 (PST) X-Received: by 10.152.182.196 with SMTP id eg4mr28839805lac.70.1424266723005; Wed, 18 Feb 2015 05:38:43 -0800 (PST) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id kh6si13258422lbc.140.2015.02.18.05.38.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Feb 2015 05:38:42 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by labgd6 with SMTP id gd6so1144255lab.7 for ; Wed, 18 Feb 2015 05:38:42 -0800 (PST) X-Received: by 10.112.85.68 with SMTP id f4mr12149203lbz.106.1424266722876; Wed, 18 Feb 2015 05:38:42 -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 h5csp2855079lbj; Wed, 18 Feb 2015 05:38:42 -0800 (PST) X-Received: by 10.140.232.84 with SMTP id d81mr186019qhc.15.1424266721446; Wed, 18 Feb 2015 05:38:41 -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 h198si12882852qhc.127.2015.02.18.05.38.40 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 18 Feb 2015 05:38:41 -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 1YO4pp-0003Kt-7G; Wed, 18 Feb 2015 13:38:37 +0000 Received: from mail-qc0-f179.google.com ([209.85.216.179]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YO4pk-0003Ko-1Y for lng-odp@lists.linaro.org; Wed, 18 Feb 2015 13:38:32 +0000 Received: by mail-qc0-f179.google.com with SMTP id r5so778079qcx.10 for ; Wed, 18 Feb 2015 05:38:26 -0800 (PST) X-Received: by 10.140.44.69 with SMTP id f63mr202595qga.3.1424266706877; Wed, 18 Feb 2015 05:38:26 -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 v6sm8022513qah.19.2015.02.18.05.38.23 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Feb 2015 05:38:25 -0800 (PST) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Wed, 18 Feb 2015 15:38:09 +0200 Message-Id: <1424266689-14074-1-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.3.0 X-Topics: patch Subject: [lng-odp] [PATCH v2] 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.215.41 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 | 25 +++++++++++++++++++++++-- include/odp/api/schedule.h | 15 ++++++++++++--- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/include/odp/api/queue.h b/include/odp/api/queue.h index 9519edf..85b0fd7 100644 --- a/include/odp/api/queue.h +++ b/include/odp/api/queue.h @@ -104,16 +104,37 @@ extern "C" { /** * @def ODP_SCHED_SYNC_NONE * Queue not synchronised + * + * The scheduler does not provide event synchronisation or ordering, only load + * balancing. Events can be scheduled freely to multiple threads for concurrent + * processing. */ /** * @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. The thread is guaranteed to have exclusive (atomic) access to the + * associated queue context and event ordering is maintained. This enables the + * user to avoid SW synchronisation for the same. + * + * The atomic queue is dedicated to the thread until it requests another event + * from the scheduler (which implicitly releases the queue) or calls + * odp_schedule_release_atomic(), which allows the scheduler to release the + * queue immediately. */ /** * @def ODP_SCHED_SYNC_ORDERED - * Ordered queue + * Ordered queue synchronisation + * + * Events from an ordered queue can be scheduled to multiple threads for + * concurrent processing. The source queue (dequeue) ordering 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 or + * synchronisation is not limited. */ /** diff --git a/include/odp/api/schedule.h b/include/odp/api/schedule.h index 5c08357..3bf0578 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 pre-scheduled 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). + * (pre-scheduled) 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 events from the same queue to some other 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);