From patchwork Mon Aug 24 04:06:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 52613 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by patches.linaro.org (Postfix) with ESMTPS id E243320AF6 for ; Mon, 24 Aug 2015 04:07:29 +0000 (UTC) Received: by labia3 with SMTP id ia3sf10971601lab.3 for ; Sun, 23 Aug 2015 21:07:28 -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=SPorsIduUdwgwbDAyPvLMZu76qveh2rcjYebFpgFJHc=; b=guMvZq39h4qY3xx3tfWaTLQiGlq6jZ87tBPgC3v71U3+BFZnVUi/RPs2idSL50s8hy cv5ELRBq5kYiu505Bm1K5rrZTFPbQtgPxC58wtJ9/1xE4Oy/E541OnQryLm2CjM8cRYP 82PGTlWaoCHr8LFCFivgXXl5/EO5yJ293fW8W8oFW5kaBUUtzQNXewTCyztnhoMMozzi lpHpyJRAuHHz+92dmHPlWPmNWrBRfrwloSwfwb54a6C+JDYR/WGxV/3Sgvo8cXlZgRy2 +8hWVnjW7arqoIdTUoArVDPDR0T/kpAkmwfT5LgGps11QJjY+yvKC9AFAwTiZEi96fDu ZqLg== X-Gm-Message-State: ALoCoQlgA8VsqKOk5+icQuXqdX968y6zfeiKJ07a0O02r0gaRE+PZOwR4k6bit02fC6HiNis2n43 X-Received: by 10.112.89.228 with SMTP id br4mr6160206lbb.3.1440389248929; Sun, 23 Aug 2015 21:07:28 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.110 with SMTP id v14ls515627lal.19.gmail; Sun, 23 Aug 2015 21:07:28 -0700 (PDT) X-Received: by 10.112.201.36 with SMTP id jx4mr18806695lbc.9.1440389248783; Sun, 23 Aug 2015 21:07:28 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id c1si311025laa.72.2015.08.23.21.07.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Aug 2015 21:07:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by labia3 with SMTP id ia3so5074883lab.3 for ; Sun, 23 Aug 2015 21:07:28 -0700 (PDT) X-Received: by 10.152.21.196 with SMTP id x4mr18062388lae.117.1440389248651; Sun, 23 Aug 2015 21:07:28 -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 yc8csp2206339lbb; Sun, 23 Aug 2015 21:07:27 -0700 (PDT) X-Received: by 10.50.59.180 with SMTP id a20mr13703956igr.31.1440389246688; Sun, 23 Aug 2015 21:07:26 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id j21si6690051ioo.187.2015.08.23.21.07.25; Sun, 23 Aug 2015 21:07:26 -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 ABF9061C6C; Mon, 24 Aug 2015 04:07:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal 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 ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 2A9CD61C89; Mon, 24 Aug 2015 04:06:52 +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 4187F61C65; Mon, 24 Aug 2015 04:06:44 +0000 (UTC) Received: from mail-oi0-f53.google.com (mail-oi0-f53.google.com [209.85.218.53]) by lists.linaro.org (Postfix) with ESMTPS id 3893161B59 for ; Mon, 24 Aug 2015 04:06:43 +0000 (UTC) Received: by oiey141 with SMTP id y141so72811130oie.1 for ; Sun, 23 Aug 2015 21:06:42 -0700 (PDT) X-Received: by 10.202.215.8 with SMTP id o8mr18496100oig.47.1440389202753; Sun, 23 Aug 2015 21:06:42 -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 ru8sm9436956oeb.8.2015.08.23.21.06.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Aug 2015 21:06:42 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Sun, 23 Aug 2015 23:06:29 -0500 Message-Id: <1440389196-28814-2-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1440389196-28814-1-git-send-email-bill.fischofer@linaro.org> References: <1440389196-28814-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH 1/8] api: scheduler: scheduler group additional APIs 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.52 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 scheduler group APIs: odp_schedule_group_lookup() odp_schedule_group_join() odp_schedule_group_leave() odp_schedule_group_thrmask() Signed-off-by: Bill Fischofer --- include/odp/api/schedule.h | 66 ++++++++++++++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 23 deletions(-) diff --git a/include/odp/api/schedule.h b/include/odp/api/schedule.h index 36e52cd..5837f69 100644 --- a/include/odp/api/schedule.h +++ b/include/odp/api/schedule.h @@ -187,12 +187,12 @@ int odp_schedule_num_prio(void); /** * Schedule group create * - * Creates a schedule group with the thread mask. Only threads in the + * Create a schedule group with the specified thread mask. Only threads in the * mask will receive events from a queue that belongs to the schedule group. * Thread masks of various schedule groups may overlap. There are predefined * groups such as ODP_SCHED_GROUP_ALL and ODP_SCHED_GROUP_WORKER, which are - * always present and automatically updated. Group name is optional - * (may be NULL) and can have ODP_SCHED_GROUP_NAME_LEN characters in maximum. + * always present and automatically updated. Group name is optional (may be + * NULL) and can contain a maximum of ODP_SCHED_GROUP_NAME_LEN characters. * * @param name Schedule group name * @param mask Thread mask @@ -208,7 +208,7 @@ odp_schedule_group_t odp_schedule_group_create(const char *name, /** * Schedule group destroy * - * Destroys a schedule group. All queues belonging to the schedule group must + * Destroy a schedule group. All queues belonging to the schedule group must * be destroyed before destroying the group. Other operations on this group * must not be invoked in parallel. * @@ -220,41 +220,61 @@ odp_schedule_group_t odp_schedule_group_create(const char *name, int odp_schedule_group_destroy(odp_schedule_group_t group); /** - * Initialize ordered context lock + * Look up a schedule group by name * - * Initialize an ordered queue context lock. The lock can be associated only - * with ordered queues and used only within an ordered synchronization context. + * Return the handle of a schedule group from its name * - * @param queue Ordered queue - * @param lock Ordered context lock + * @param name Name of schedule group + * + * @return Handle of schedule group for specified name + * @retval ODP_SCHEDULE_GROUP_INVALID No matching schedule group found + */ +odp_schedule_group_t odp_schedule_group_lookup(const char *name); + +/** + * Join a schedule group + * + * Join a threadmask to an existing schedule group + * + * @param group Schdule group handle + * @param mask Thread mask * * @retval 0 on success * @retval <0 on failure */ -int odp_schedule_olock_init(odp_queue_t queue, odp_schedule_olock_t *lock); +int odp_schedule_group_join(odp_schedule_group_t group, + const odp_thrmask_t *mask); /** - * Acquire ordered context lock + * Leave a schedule group + * + * Remove a threadmask from an existing schedule group + * + * @param group Schedule group handle + * @param mask Thread mask * - * This call is valid only when holding an ordered synchronization context. The - * lock is used to protect a critical section that is executed within an - * ordered context. Threads enter the critical section in the order determined - * by the context (source queue). Lock ordering is automatically skipped for - * threads that release the context instead of calling the lock. + * @retval 0 on success + * @retval <0 on failure * - * @param lock Ordered context lock + * @note Leaving a schedule group means threads in the specified mask will no + * longer receive events from queues belonging to the specified schedule + * group. This effect is not instantaneous, however, and events that have been + * prestaged may still be presented to the masked threads. */ -void odp_schedule_olock_lock(odp_schedule_olock_t *lock); +int odp_schedule_group_leave(odp_schedule_group_t group, + const odp_thrmask_t *mask); /** - * Release ordered context lock + * Get a schedule group's thrmask * - * This call is valid only when holding an ordered synchronization context. - * Release a previously locked ordered context lock. + * @param group Schedule group handle + * @param[out] thrmask The current thrmask used for this schedule group * - * @param lock Ordered context lock + * @retval 0 On success + * @retval <0 Invalid group specified */ -void odp_schedule_olock_unlock(odp_schedule_olock_t *lock); +int odp_schedule_group_thrmask(odp_schedule_group_t group, + odp_thrmask_t *thrmask); /** * @}