> -----Original Message-----
> From: ext Hongbo Zhang [mailto:hongbo.zh...@linaro.org]
> Sent: Tuesday, September 08, 2015 2:21 PM
> To: Savolainen, Petri (Nokia - FI/Espoo)
> Cc: ext Bill Fischofer; ext hongbo.zh...@freescale.com;
> stuart.has...@arm.com; lng-odp@lists.linaro.org
> Subject: Re: [lng-odp] [API-NEXT PATCH v4 09/10] linux-generic:
> cpumask: add API odp_cpumask_available()
> 
> On 4 September 2015 at 15:44, Savolainen, Petri (Nokia - FI/Espoo)
> <petri.savolai...@nokia.com> wrote:
> > Cpu mask API mainly manipulate the mask. So, odp_cpumask_max can be
> mixed to
> > return “max” or “last” cpu ID. Same problem with plain
> odp_cpumask_all –
> > it’s too close to “set all cpu IDs in the mask”.
> >
> >
> >
> > I think these “extra” functions which return system preferences
> (default
> > workers, controllers, all available for ODP, all CPUs on the device
> (also
> > those unavailable), …)  can be a bit longer and thus more
> descriptive.
> >
> Yes "all available" seems more descriptive.
> 
> But let us think in another way, Stuart suggested me to introduce such
> a function, further thought would be that this function can replace
> the current odp_cpu_count(), I didn't take the further steps into this
> patch set till now.
> 
> Currently the only user of this new API is the validation code, I use
> this API to iterate each CPU, so is it important enough to introduce
> such a new API?

It could replace cpu_count(). The mask and the count are related. User should 
use both when iterating through CPUs. A  count without the mask builds 
expectation that available CPU IDs are from 0 to count - 1, which may not be 
the case.

User needs cpu count/mask for e.g. allocating resources per CPU and iterating 
those.

-Petri


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

Reply via email to