From patchwork Mon Sep 14 12:05:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Savolainen, Petri \(Nokia - FI/Espoo\)" X-Patchwork-Id: 53546 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id C44E822B17 for ; Mon, 14 Sep 2015 12:05:49 +0000 (UTC) Received: by lbcjc2 with SMTP id jc2sf44671509lbc.0 for ; Mon, 14 Sep 2015 05:05:48 -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:thread-topic :thread-index:date:message-id:references:in-reply-to:accept-language :content-language:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :content-type:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=zO9jWuoIXaliSoAJBYbyaEssmanLrAPROUubSMPehH4=; b=gmtcWf612KOJohuXamU/MemEn3wTQ4L/2i7R+c7scTY0MptrtqE4JcJukj9wf91kxr aOf48XOkHvxVgozMQQD2bpYHyC88boH5Oivvvs/AuK5r0FEATG0EFMzTLNorAqsnPuBv 0dmgxCWkx9h5OIP4wgNDVz/NT45EOpACMPP87zvbHb/ufwOsDgzooIq741dsRyCpv4Be XxreNuGOxlxO3akXlvh7x0FRcJdlP173prsX0/qErU/DBT4d7eDiM7LenX+v4hgrMxNN P68EGKdpBgRgGXUZJiDvNskpfmvQn/B9G7or0xrHs4d7tRE+NisHzOOwVxgTyDI+xbBC Eu9g== X-Gm-Message-State: ALoCoQkQhqKVpZjavkeThHvEBRXAaKTI/mwBnXfHnU9DpIN6fQPTJvk4tqcwRh70zyxlSdct9zU1 X-Received: by 10.112.145.3 with SMTP id sq3mr1029776lbb.7.1442232348736; Mon, 14 Sep 2015 05:05:48 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.8.133 with SMTP id dk5ls584158lad.75.gmail; Mon, 14 Sep 2015 05:05:48 -0700 (PDT) X-Received: by 10.112.125.102 with SMTP id mp6mr5367980lbb.46.1442232348434; Mon, 14 Sep 2015 05:05:48 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id c2si9489836lac.65.2015.09.14.05.05.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2015 05:05:48 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lbcjc2 with SMTP id jc2so65988250lbc.0 for ; Mon, 14 Sep 2015 05:05:48 -0700 (PDT) X-Received: by 10.152.170.225 with SMTP id ap1mr4300794lac.72.1442232348176; Mon, 14 Sep 2015 05:05:48 -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.59.35 with SMTP id w3csp1159564lbq; Mon, 14 Sep 2015 05:05:47 -0700 (PDT) X-Received: by 10.55.192.20 with SMTP id o20mr20938272qki.44.1442232347170; Mon, 14 Sep 2015 05:05:47 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 143si11649426qhc.102.2015.09.14.05.05.45; Mon, 14 Sep 2015 05:05:47 -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 A253961CB8; Mon, 14 Sep 2015 12:05:45 +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=-6.9 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_HI,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 8C79B61B63; Mon, 14 Sep 2015 12:05:39 +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 F00E861CA6; Mon, 14 Sep 2015 12:05:36 +0000 (UTC) Received: from demumfd002.nsn-inter.net (demumfd002.nsn-inter.net [93.183.12.31]) by lists.linaro.org (Postfix) with ESMTPS id 80969619C4 for ; Mon, 14 Sep 2015 12:05:35 +0000 (UTC) Received: from demuprx016.emea.nsn-intra.net ([10.150.129.55]) by demumfd002.nsn-inter.net (8.15.2/8.15.2) with ESMTPS id t8EC5SKJ027244 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 14 Sep 2015 12:05:28 GMT Received: from DEMUHTC002.nsn-intra.net ([10.159.42.33]) by demuprx016.emea.nsn-intra.net (8.12.11.20060308/8.12.11) with ESMTP id t8EC5S2U017708 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Mon, 14 Sep 2015 14:05:28 +0200 Received: from DEMUHTC013.nsn-intra.net (10.159.42.44) by DEMUHTC002.nsn-intra.net (10.159.42.33) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 14 Sep 2015 14:05:27 +0200 Received: from DEMUMBX002.nsn-intra.net ([169.254.3.192]) by DEMUHTC013.nsn-intra.net ([10.159.42.44]) with mapi id 14.03.0248.002; Mon, 14 Sep 2015 14:05:27 +0200 From: "Savolainen, Petri (Nokia - FI/Espoo)" To: EXT Bill Fischofer Thread-Topic: [lng-odp] [API-NEXT PATCH v2 1/3] api: init: added thread count params Thread-Index: AQHQ7KjiOz6h/U2zZU61xeg+la7R954771aQ Date: Mon, 14 Sep 2015 12:05:26 +0000 Message-ID: References: <1441976144-20403-1-git-send-email-petri.savolainen@nokia.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.159.42.103] MIME-Version: 1.0 X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-size: 18182 X-purgate-ID: 151667::1442232328-0000538C-AC75C957/0/0 X-Topics: patch Cc: LNG ODP Mailman List Subject: Re: [lng-odp] [API-NEXT PATCH v2 1/3] api: init: added thread count params 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: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: petri.savolainen@nokia.com 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.180 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 From: EXT Bill Fischofer [mailto:bill.fischofer@linaro.org] Sent: Friday, September 11, 2015 6:45 PM To: Savolainen, Petri (Nokia - FI/Espoo) Cc: LNG ODP Mailman List Subject: Re: [lng-odp] [API-NEXT PATCH v2 1/3] api: init: added thread count params On Fri, Sep 11, 2015 at 7:55 AM, Petri Savolainen > wrote: Added max number of worker/control threads as global init parameters. Implementation can e.g. optimize it's per worker thread resource reservation or configuration accordingly. Maximum values are platform specific. These values come typically from the user as command line arguments, etc. Signed-off-by: Petri Savolainen > --- include/odp/api/init.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) Ordering would be relevant only for backward *binary* compatibility. Currently, we expect user to recompile between versions. The idea is that num_worker/control is likely needed to be set every time, but log_fn and abort_fn only when user wants to change those services from their defaults. I was thinking 0 as default also, but it’s actually likely that user sets one of those to zero (e.g. launches only worker threads). BUT both being zero would not make sense from user POV, and we can use that as the default. I’ll add that. -Petri /** @@ -133,9 +141,10 @@ typedef struct odp_platform_init_t { * functions. * * @param params Those parameters that are interpreted by the ODP API. + * Use NULL to set all parameters to their defaults. * @param platform_params Those parameters that are passed without * interpretation by the ODP API to the implementation. - * + * Use NULL to set all parameters to their defaults. * @retval 0 on success * @retval <0 on failure * -- 2.5.1 _______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp diff --git a/include/odp/api/init.h b/include/odp/api/init.h index 0683d8d..d327305 100644 --- a/include/odp/api/init.h +++ b/include/odp/api/init.h @@ -110,8 +110,16 @@ typedef void (*odp_abort_func_t)(void) ODP_NORETURN; * @note It is expected that all unassigned members are zero */ typedef struct odp_init_t { - odp_log_func_t log_fn; /**< Replacement for the default log fn */ - odp_abort_func_t abort_fn; /**< Replacement for the default abort fn */ + /** Maximum number of worker threads the user will run concurrently. + Valid range is from 0 to platform specific maximum. */ + int num_worker; + /** Maximum number of control threads the user will run concurrently. + Valid range is from 0 to platform specific maximum. */ + int num_control; + /** Replacement for the default log fn */ + odp_log_func_t log_fn; + /** Replacement for the default abort fn */ + odp_abort_func_t abort_fn; } odp_init_t; Why not add the new parameters at the end of the struct? That way we're at least making an attempt at backwards compatibility (something we need to be thinking about going forward). I'd also have the convention that if either num_worker or num_control are 0 this means application is providing no hints and implementation defaults should apply for these values. That way when odp_init_init() is called to initialize this struct (which also should be added) we're future-proofed.