> -----Original Message-----
> From: EXT Gary S. Robertson [mailto:gary.robert...@linaro.org]
> Sent: Saturday, January 23, 2016 1:37 AM
> To: mike.hol...@linaro.org; bill.fischo...@linaro.org;
> maxim.uva...@linaro.org; anders.rox...@linaro.org;
> stuart.has...@linaro.org; petri.savolai...@linaro.org
> Cc: lng-odp@lists.linaro.org; Gary S. Robertson
> Subject: [lng-odp][API_NEXT PATCH V3 01/01] ODP API: add control/worker
> cpumasks to init data
> 
> Adds pointers to externally supplied cpumasks for
> control and worker CPUs to the ODP global init data
> which is passed as an argument to odp_init_global.
> The intent is to allow an external entity to pass in
> lists of the CPU resources available to the current
> ODP application.
> 
> It is assumed that these pointers would be NULL
> unless explicitly populated prior to calling
> odp_init_global.
> 
> odp_init_global would respond to NULL pointers
> here by ensuring that odp_cpumask_default_control and
> odp_cpumask_default_worker would return the
> platform-specific default CPU configurations.
> 
> If these pointers were not NULL when odp_init_global was called,
> then the above functions would return cpumasks reflecting the
> (possibly amended) contents of the referenced cpumasks
> instead of the platform defaults.
> 
> Signed-off-by: Gary S. Robertson <gary.robert...@linaro.org>
> ---
>  include/odp/api/init.h | 35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
> 
> diff --git a/include/odp/api/init.h b/include/odp/api/init.h
> index e667d25..448a520 100644
> --- a/include/odp/api/init.h
> +++ b/include/odp/api/init.h
> @@ -31,6 +31,7 @@ extern "C" {
>  #include <odp/std_types.h>
>  #include <odp/hints.h>
>  #include <odp/thread.h>
> +#include <odp/cpumask.h>
> 
>  /** @defgroup odp_initialization ODP INITIALIZATION
>   *  Initialisation operations.
> @@ -118,6 +119,40 @@ typedef struct odp_init_t {
>           Valid range is from 0 to platform specific maximum. Set both
>           num_worker and num_control to zero for default number of
> threads. */
>       int num_control;
> +     /** Pointer to bit mask mapping CPUs available to this ODP instance
> +         for running worker threads.
> +         Valid range for mask is from 0 to platform specific maximum CPU.
> +         Initialize to a NULL pointer to use default cpu mapping and
> +         default isolation setup (or the lack of isolation) for
> +         worker CPUs.
> +         If worker CPUs are expected to provide isolated runtime
> +         environments for worker threads, then the contents of this
> cpumask
> +         should be unique for each ODP instance running concurrently
> +         on the underlying platform, and should not contain any
> +         control CPUs.
> +         This cpumask is used only to convey externally supplied
> +         information regarding worker CPU resources available to this
> +         ODP instance during initialization.  Applications code must call
> +         odp_cpumask_default_worker() to obtain information as to the

Since the function above returns the default mask for workers, the call makes 
sense (only) when user wants to use default settings of the implementation. So, 
the "must" above should be "may". When user does not know or care which CPUs to 
use 
it can pass NULL here and call default_worker().

If user passes a bad CPU mask (a bad range of CPUs), the global init should 
fail.


> +         CPU resources available for worker threads. */
> +     odp_cpumask_t *worker_cpus;
> +     /** Pointer to bit mask mapping CPUs available to this ODP instance
> +         for running control threads.
> +         Valid range for mask is from 0 to platform specific maximum CPU.
> +         Initialize to a NULL pointer to use default cpu mapping for
> +         control CPUs.
> +         Control CPUs are expected to provide shared, non-isolated
> +         runtime environments for control threads.
> +         It must therefore be anticipated that this cpumask may be
> +         identical for all ODP instances running concurrently
> +         on the underlying platform and may specify CPU resources
> +         to be shared among all concurrent ODP instances.
> +         This cpumask is used only to convey externally supplied
> +         information regarding control CPU resources available to this
> +         ODP instance during initialization.  Applications code must call

Same here.

-Petri


> +         odp_cpumask_default_control() to obtain information as to the
> +         CPU resources available for control threads. */
> +     odp_cpumask_t *control_cpus;
>       /** Replacement for the default log fn */
>       odp_log_func_t log_fn;
>       /** Replacement for the default abort fn */
> --
> 1.9.1

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to