Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

2015-03-12 Thread Taras Kondratiuk

On 03/12/2015 12:03 PM, Savolainen, Petri (Nokia - FI/Espoo) wrote:




-Original Message-
From: ext Taras Kondratiuk [mailto:taras.kondrat...@linaro.org]
Sent: Wednesday, March 11, 2015 5:18 PM
To: Savolainen, Petri (Nokia - FI/Espoo); ext Christophe Milard; lng-
o...@lists.linaro.org
Subject: Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

On 03/11/2015 04:46 PM, Savolainen, Petri (Nokia - FI/Espoo) wrote:

Continuation of cpumask discussion on the call... For creating arbitrary
masks (e.g. fill in a mask with CPU ids of another ODP program in the
system, or testing all possible mask bits), we may need two more calls:

/**

* @return Maximum number of CPUs a mask can hold

*/

int odp_cpumask_max_cpus(void)

/**

   * Set all CPUs in the mask

   *

   * After the call, the mask has odp_cpumask_max_cpus() CPUs set.

* @note CPU numbering may not be contiguous.

*/

void odp_cpumask_setall(odp_cpumask_t *mask)

-Petri

*From:*lng-odp-boun...@lists.linaro.org
[mailto:lng-odp-boun...@lists.linaro.org] *On Behalf Of *ext Savolainen,
Petri (Nokia - FI/Espoo)
*Sent:* Wednesday, March 11, 2015 2:09 PM
*To:* ext Christophe Milard; lng-odp@lists.linaro.org
*Subject:* Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

Actually, this is equal to odp_cpu_max():

odp_cpumask_t mask;

odp_cpu_mask(mask)

odp_cpumask_last(mask)

So maybe odp_cpu_mask() is only new thing we need.


Hi Petri

It is not clear to me why do we need odp_cpu_* and odp_cpumask_* API.

They are used now to create threads and set CPU affinity. But this is
done by ODP helpers, because it is out of ODP scope. Shouldn't 'cpu' and
'cpumask' be a part of helpers too?


The original idea was to use cpumask in definition of odp_schedule_group_t 
(still on todo list). I need go through that use case and see if e.g. a thread 
mask would work instead.


Currently cpumask is used for 'real' CPUs, but IMO scheduler group
should operate on thread IDs instead.



E.g. odp_cpu_id() is good for debugging (e.g. that thread pinning is working).



___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

2015-03-12 Thread Ola Liljedahl
On 12 March 2015 at 11:34, Taras Kondratiuk taras.kondrat...@linaro.org
wrote:

 On 03/12/2015 12:03 PM, Savolainen, Petri (Nokia - FI/Espoo) wrote:



  -Original Message-
 From: ext Taras Kondratiuk [mailto:taras.kondrat...@linaro.org]
 Sent: Wednesday, March 11, 2015 5:18 PM
 To: Savolainen, Petri (Nokia - FI/Espoo); ext Christophe Milard; lng-
 o...@lists.linaro.org
 Subject: Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

 On 03/11/2015 04:46 PM, Savolainen, Petri (Nokia - FI/Espoo) wrote:

 Continuation of cpumask discussion on the call... For creating arbitrary
 masks (e.g. fill in a mask with CPU ids of another ODP program in the
 system, or testing all possible mask bits), we may need two more calls:

 /**

 * @return Maximum number of CPUs a mask can hold

 */

 int odp_cpumask_max_cpus(void)

 /**

* Set all CPUs in the mask

*

* After the call, the mask has odp_cpumask_max_cpus() CPUs set.

 * @note CPU numbering may not be contiguous.

 */

 void odp_cpumask_setall(odp_cpumask_t *mask)

 -Petri

 *From:*lng-odp-boun...@lists.linaro.org
 [mailto:lng-odp-boun...@lists.linaro.org] *On Behalf Of *ext
 Savolainen,
 Petri (Nokia - FI/Espoo)
 *Sent:* Wednesday, March 11, 2015 2:09 PM
 *To:* ext Christophe Milard; lng-odp@lists.linaro.org
 *Subject:* Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

 Actually, this is equal to odp_cpu_max():

 odp_cpumask_t mask;

 odp_cpu_mask(mask)

 odp_cpumask_last(mask)

 So maybe odp_cpu_mask() is only new thing we need.


 Hi Petri

 It is not clear to me why do we need odp_cpu_* and odp_cpumask_* API.

 They are used now to create threads and set CPU affinity. But this is
 done by ODP helpers, because it is out of ODP scope. Shouldn't 'cpu' and
 'cpumask' be a part of helpers too?


 The original idea was to use cpumask in definition of
 odp_schedule_group_t (still on todo list). I need go through that use case
 and see if e.g. a thread mask would work instead.


 Currently cpumask is used for 'real' CPUs, but IMO scheduler group
 should operate on thread IDs instead.

We need a clear understanding of these concepts so we can extend the
architecture to use (CPU or thread) groups for local scheduling.



 E.g. odp_cpu_id() is good for debugging (e.g. that thread pinning is
 working).



 ___
 lng-odp mailing list
 lng-odp@lists.linaro.org
 http://lists.linaro.org/mailman/listinfo/lng-odp

___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

2015-03-12 Thread Savolainen, Petri (Nokia - FI/Espoo)


 -Original Message-
 From: ext Taras Kondratiuk [mailto:taras.kondrat...@linaro.org]
 Sent: Wednesday, March 11, 2015 5:18 PM
 To: Savolainen, Petri (Nokia - FI/Espoo); ext Christophe Milard; lng-
 o...@lists.linaro.org
 Subject: Re: [lng-odp] odp_cpu_count() vs odp_cpumask size
 
 On 03/11/2015 04:46 PM, Savolainen, Petri (Nokia - FI/Espoo) wrote:
  Continuation of cpumask discussion on the call... For creating arbitrary
  masks (e.g. fill in a mask with CPU ids of another ODP program in the
  system, or testing all possible mask bits), we may need two more calls:
 
  /**
 
  * @return Maximum number of CPUs a mask can hold
 
  */
 
  int odp_cpumask_max_cpus(void)
 
  /**
 
* Set all CPUs in the mask
 
*
 
* After the call, the mask has odp_cpumask_max_cpus() CPUs set.
 
 * @note CPU numbering may not be contiguous.
 
  */
 
  void odp_cpumask_setall(odp_cpumask_t *mask)
 
  -Petri
 
  *From:*lng-odp-boun...@lists.linaro.org
  [mailto:lng-odp-boun...@lists.linaro.org] *On Behalf Of *ext Savolainen,
  Petri (Nokia - FI/Espoo)
  *Sent:* Wednesday, March 11, 2015 2:09 PM
  *To:* ext Christophe Milard; lng-odp@lists.linaro.org
  *Subject:* Re: [lng-odp] odp_cpu_count() vs odp_cpumask size
 
  Actually, this is equal to odp_cpu_max():
 
  odp_cpumask_t mask;
 
  odp_cpu_mask(mask)
 
  odp_cpumask_last(mask)
 
  So maybe odp_cpu_mask() is only new thing we need.
 
 Hi Petri
 
 It is not clear to me why do we need odp_cpu_* and odp_cpumask_* API.
 
 They are used now to create threads and set CPU affinity. But this is
 done by ODP helpers, because it is out of ODP scope. Shouldn't 'cpu' and
 'cpumask' be a part of helpers too?

The original idea was to use cpumask in definition of odp_schedule_group_t 
(still on todo list). I need go through that use case and see if e.g. a thread 
mask would work instead.

E.g. odp_cpu_id() is good for debugging (e.g. that thread pinning is working). 

-Petri






___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

2015-03-11 Thread Taras Kondratiuk

On 03/11/2015 04:46 PM, Savolainen, Petri (Nokia - FI/Espoo) wrote:

Continuation of cpumask discussion on the call… For creating arbitrary
masks (e.g. fill in a mask with CPU ids of another ODP program in the
system, or testing all possible mask bits), we may need two more calls:

/**

* @return Maximum number of CPUs a mask can hold

*/

int odp_cpumask_max_cpus(void)

/**

  * Set all CPUs in the mask

  *

  * After the call, the mask has odp_cpumask_max_cpus() CPUs set.

   * @note CPU numbering may not be contiguous.

*/

void odp_cpumask_setall(odp_cpumask_t *mask)

-Petri

*From:*lng-odp-boun...@lists.linaro.org
[mailto:lng-odp-boun...@lists.linaro.org] *On Behalf Of *ext Savolainen,
Petri (Nokia - FI/Espoo)
*Sent:* Wednesday, March 11, 2015 2:09 PM
*To:* ext Christophe Milard; lng-odp@lists.linaro.org
*Subject:* Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

Actually, this is equal to odp_cpu_max():

odp_cpumask_t mask;

odp_cpu_mask(mask)

odp_cpumask_last(mask)

So maybe odp_cpu_mask() is only new thing we need.


Hi Petri

It is not clear to me why do we need odp_cpu_* and odp_cpumask_* API.

They are used now to create threads and set CPU affinity. But this is
done by ODP helpers, because it is out of ODP scope. Shouldn't 'cpu' and
'cpumask' be a part of helpers too?

___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

2015-03-11 Thread Savolainen, Petri (Nokia - FI/Espoo)
CPU IDs are system dependent. So e.g. odp_cpu_count() == 2 would not 
necessarily result a cpumask with cpus 0 and 1 set, but e.g. cpus 7 and 17 set. 
Typically, the mask comes from user/system level (user has decided to run the 
ODP app on cpus 7 and 17).

We may need two new functions:

/**
* @return the max CPU available to the ODP program
*/
int odp_cpu_max(void)

, but still that would not tell which ids between 0 and max are valid, so we 
need also

/**
  *  Output mask of CPUs available to the ODP program
 */
void odp_cpu_mask(odp_cpumask_t *mask)


-Petri


From: lng-odp-boun...@lists.linaro.org 
[mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of ext Christophe Milard
Sent: Tuesday, March 10, 2015 4:22 PM
To: lng-odp@lists.linaro.org
Subject: [lng-odp] odp_cpu_count() vs odp_cpumask size

Hi,
I am writing validation tests for the odp_cpumask functions.
The question is: How many CPUs should the cpu mask be tested for?.
Of course, the answer is implementation dependent, but if we want the tests to 
be non platform dependent, the tests should know the max number of CPU the mask 
could contain.
In the API the function odp_cpu_count(void) is defined. This function reports 
the number of CPUs available to this ODP program. Is this also the maximum 
number of CPU in the mask, or should the mask also have room for non odp 
reserved cpus?
For instance, in a system running 2 linux (control) cpus, and 5 ODP cpus, 
should the mask be tested for 5 or 7 CPUs? If 7 is the answer, how do I get 
this number from the current API...
/Christophe.
___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

2015-03-11 Thread Savolainen, Petri (Nokia - FI/Espoo)
Actually, this is equal to odp_cpu_max():

odp_cpumask_t mask;
odp_cpu_mask(mask)
odp_cpumask_last(mask)

So maybe odp_cpu_mask() is only new thing we need.

-Petri

From: lng-odp-boun...@lists.linaro.org 
[mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of ext Savolainen, Petri 
(Nokia - FI/Espoo)
Sent: Wednesday, March 11, 2015 2:03 PM
To: ext Christophe Milard; lng-odp@lists.linaro.org
Subject: Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

CPU IDs are system dependent. So e.g. odp_cpu_count() == 2 would not 
necessarily result a cpumask with cpus 0 and 1 set, but e.g. cpus 7 and 17 set. 
Typically, the mask comes from user/system level (user has decided to run the 
ODP app on cpus 7 and 17).

We may need two new functions:

/**
* @return the max CPU available to the ODP program
*/
int odp_cpu_max(void)

, but still that would not tell which ids between 0 and max are valid, so we 
need also

/**
  *  Output mask of CPUs available to the ODP program
 */
void odp_cpu_mask(odp_cpumask_t *mask)


-Petri


From: lng-odp-boun...@lists.linaro.orgmailto:lng-odp-boun...@lists.linaro.org 
[mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of ext Christophe Milard
Sent: Tuesday, March 10, 2015 4:22 PM
To: lng-odp@lists.linaro.orgmailto:lng-odp@lists.linaro.org
Subject: [lng-odp] odp_cpu_count() vs odp_cpumask size

Hi,
I am writing validation tests for the odp_cpumask functions.
The question is: How many CPUs should the cpu mask be tested for?.
Of course, the answer is implementation dependent, but if we want the tests to 
be non platform dependent, the tests should know the max number of CPU the mask 
could contain.
In the API the function odp_cpu_count(void) is defined. This function reports 
the number of CPUs available to this ODP program. Is this also the maximum 
number of CPU in the mask, or should the mask also have room for non odp 
reserved cpus?
For instance, in a system running 2 linux (control) cpus, and 5 ODP cpus, 
should the mask be tested for 5 or 7 CPUs? If 7 is the answer, how do I get 
this number from the current API...
/Christophe.
___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

2015-03-11 Thread Savolainen, Petri (Nokia - FI/Espoo)
Continuation of cpumask discussion on the call… For creating arbitrary masks 
(e.g. fill in a mask with CPU ids of another ODP program in the system, or 
testing all possible mask bits), we may need two more calls:

/**
 * @return Maximum number of CPUs a mask can hold
 */
int odp_cpumask_max_cpus(void)

/**
 * Set all CPUs in the mask
 *
 * After the call, the mask has odp_cpumask_max_cpus() CPUs set.
  * @note CPU numbering may not be contiguous.
  */
void odp_cpumask_setall(odp_cpumask_t *mask)


-Petri



From: lng-odp-boun...@lists.linaro.org 
[mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of ext Savolainen, Petri 
(Nokia - FI/Espoo)
Sent: Wednesday, March 11, 2015 2:09 PM
To: ext Christophe Milard; lng-odp@lists.linaro.org
Subject: Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

Actually, this is equal to odp_cpu_max():

odp_cpumask_t mask;
odp_cpu_mask(mask)
odp_cpumask_last(mask)

So maybe odp_cpu_mask() is only new thing we need.

-Petri

From: lng-odp-boun...@lists.linaro.orgmailto:lng-odp-boun...@lists.linaro.org 
[mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of ext Savolainen, Petri 
(Nokia - FI/Espoo)
Sent: Wednesday, March 11, 2015 2:03 PM
To: ext Christophe Milard; 
lng-odp@lists.linaro.orgmailto:lng-odp@lists.linaro.org
Subject: Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

CPU IDs are system dependent. So e.g. odp_cpu_count() == 2 would not 
necessarily result a cpumask with cpus 0 and 1 set, but e.g. cpus 7 and 17 set. 
Typically, the mask comes from user/system level (user has decided to run the 
ODP app on cpus 7 and 17).

We may need two new functions:

/**
* @return the max CPU available to the ODP program
*/
int odp_cpu_max(void)

, but still that would not tell which ids between 0 and max are valid, so we 
need also

/**
  *  Output mask of CPUs available to the ODP program
 */
void odp_cpu_mask(odp_cpumask_t *mask)


-Petri


From: lng-odp-boun...@lists.linaro.orgmailto:lng-odp-boun...@lists.linaro.org 
[mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of ext Christophe Milard
Sent: Tuesday, March 10, 2015 4:22 PM
To: lng-odp@lists.linaro.orgmailto:lng-odp@lists.linaro.org
Subject: [lng-odp] odp_cpu_count() vs odp_cpumask size

Hi,
I am writing validation tests for the odp_cpumask functions.
The question is: How many CPUs should the cpu mask be tested for?.
Of course, the answer is implementation dependent, but if we want the tests to 
be non platform dependent, the tests should know the max number of CPU the mask 
could contain.
In the API the function odp_cpu_count(void) is defined. This function reports 
the number of CPUs available to this ODP program. Is this also the maximum 
number of CPU in the mask, or should the mask also have room for non odp 
reserved cpus?
For instance, in a system running 2 linux (control) cpus, and 5 ODP cpus, 
should the mask be tested for 5 or 7 CPUs? If 7 is the answer, how do I get 
this number from the current API...
/Christophe.
___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] odp_cpu_count() vs odp_cpumask size

2015-03-10 Thread Christophe Milard
Hi,
I am writing validation tests for the odp_cpumask functions.
The question is: How many CPUs should the cpu mask be tested for?.

Of course, the answer is implementation dependent, but if we want the tests
to be non platform dependent, the tests should know the max number of CPU
the mask could contain.

In the API the function odp_cpu_count(void) is defined. This function
reports the number of CPUs available to this ODP program. Is this also
the maximum number of CPU in the mask, or should the mask also have room
for non odp reserved cpus?

For instance, in a system running 2 linux (control) cpus, and 5 ODP cpus,
should the mask be tested for 5 or 7 CPUs? If 7 is the answer, how do I get
this number from the current API...

/Christophe.
___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp