From patchwork Fri Aug 28 21:18:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 52809 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 4278F22EBF for ; Fri, 28 Aug 2015 21:21:04 +0000 (UTC) Received: by wibcx1 with SMTP id cx1sf736998wib.3 for ; Fri, 28 Aug 2015 14:21:03 -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=2B+NhBTpquXyHJlQC3CxuzOQbLr3lOpa5Fh+svd0PT4=; b=JB2EIQpy0PMBM/gGvaeh13je6XZAFCAGsfvcv4PvLSaBlW4RARUFqWCEPCBVG7CfA8 2gvHYGWLopvIKcriIUiGjuRXGS75VhIhEQ6jRZksU9CPaTUCm5EUcjUVb1jOAC+J38dQ xvmohx9jvb13schMOsnwpqlJbiMkg0SG+usXusXoxK0sV8dz+5w3RXKzXCFyBVW5xmFT losIpKeaAsDbZ6piuvo027j1PrhP/Vtg4Yx9IMEuMQHyY0bU2yQf1u0oE+wYTyomCR2p /EFzrBQTGGWat/hkY+co3iWf6DznlEDuoAHJ4w6ofhNPeAqasbFXd+48Y4B6JEuCBIZz M2Ag== X-Gm-Message-State: ALoCoQl/FeXXCWolfMWZ+yGUN1mIRL91MpWOjh9ZuElWsalbMbTUmapV68D6B876tPywGJnkEZA9 X-Received: by 10.112.199.5 with SMTP id jg5mr3201457lbc.14.1440796863539; Fri, 28 Aug 2015 14:21:03 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.9 with SMTP id ku9ls227144lac.37.gmail; Fri, 28 Aug 2015 14:21:03 -0700 (PDT) X-Received: by 10.152.6.231 with SMTP id e7mr5739265laa.78.1440796863396; Fri, 28 Aug 2015 14:21:03 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id cr9si6911131lad.15.2015.08.28.14.21.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Aug 2015 14:21:03 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by laboe4 with SMTP id oe4so14185593lab.0 for ; Fri, 28 Aug 2015 14:21:03 -0700 (PDT) X-Received: by 10.152.18.164 with SMTP id x4mr5843156lad.35.1440796863240; Fri, 28 Aug 2015 14:21:03 -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.151.194 with SMTP id us2csp126977lbb; Fri, 28 Aug 2015 14:21:02 -0700 (PDT) X-Received: by 10.55.26.40 with SMTP id a40mr19574906qka.33.1440796862289; Fri, 28 Aug 2015 14:21:02 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id a89si8741335qkj.127.2015.08.28.14.21.01; Fri, 28 Aug 2015 14:21:02 -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 1DDDF61D37; Fri, 28 Aug 2015 21:21:01 +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 5071761D01; Fri, 28 Aug 2015 21:19:15 +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 5BFEF61D01; Fri, 28 Aug 2015 21:19:06 +0000 (UTC) Received: from mail-oi0-f41.google.com (mail-oi0-f41.google.com [209.85.218.41]) by lists.linaro.org (Postfix) with ESMTPS id 739E861CD9 for ; Fri, 28 Aug 2015 21:19:04 +0000 (UTC) Received: by oigk185 with SMTP id k185so31663789oig.2 for ; Fri, 28 Aug 2015 14:19:04 -0700 (PDT) X-Received: by 10.202.75.72 with SMTP id y69mr2468237oia.116.1440796743947; Fri, 28 Aug 2015 14:19:03 -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 k5sm4297965oev.16.2015.08.28.14.19.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Aug 2015 14:19:03 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Fri, 28 Aug 2015 16:18:50 -0500 Message-Id: <1440796737-8636-4-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1440796737-8636-1-git-send-email-bill.fischofer@linaro.org> References: <1440796737-8636-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv4 03/10] api: schedule: add additional scheduler group 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.51 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 additional 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 | 77 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/include/odp/api/schedule.h b/include/odp/api/schedule.h index 7c5955b..b0b7425 100644 --- a/include/odp/api/schedule.h +++ b/include/odp/api/schedule.h @@ -51,6 +51,26 @@ extern "C" { */ /** + * @def ODP_SCHED_GROUP_INVALID + * Invalid scheduler group + */ + +/** + * @def ODP_SCHED_GROUP_ALL + * Predefined scheduler group of all threads + */ + +/** + * @def ODP_SCHED_GROUP_WORKER + * Predefined scheduler group of all worker threads + */ + +/** + * @def ODP_SCHED_GROUP_CONTROL + * Predefined scheduler group of all control threads + */ + +/** * Schedule wait time * * Converts nanoseconds to wait values for other schedule functions. @@ -220,6 +240,63 @@ odp_schedule_group_t odp_schedule_group_create(const char *name, int odp_schedule_group_destroy(odp_schedule_group_t group); /** + * Look up a schedule group by name + * + * Return the handle of a schedule group from its name + * + * @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_group_join(odp_schedule_group_t group, + const odp_thrmask_t *mask); + +/** + * Leave a schedule group + * + * Remove a threadmask from an existing schedule group + * + * @param group Schedule group handle + * @param mask Thread mask + * + * @retval 0 on success + * @retval <0 on failure + * + * @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. + */ +int odp_schedule_group_leave(odp_schedule_group_t group, + const odp_thrmask_t *mask); + +/** + * Get a schedule group's thrmask + * + * @param group Schedule group handle + * @param[out] thrmask The current thrmask used for this schedule group + * + * @retval 0 On success + * @retval <0 Invalid group specified + */ +int odp_schedule_group_thrmask(odp_schedule_group_t group, + odp_thrmask_t *thrmask); + +/** * Initialize ordered context lock * * Initialize an ordered queue context lock. The lock can be associated only