Re: [lng-odp] [API-NEXT PATCH 2/4] linux-gen: sched: use config max ordered locks

2017-07-07 Thread Savolainen, Petri (Nokia - FI/Espoo)


> -Original Message-
> From: Honnappa Nagarahalli [mailto:honnappa.nagaraha...@linaro.org]
> Sent: Thursday, July 06, 2017 11:00 PM
> To: Savolainen, Petri (Nokia - FI/Espoo) <petri.savolai...@nokia.com>
> Cc: lng-odp-forward <lng-odp@lists.linaro.org>
> Subject: Re: [lng-odp] [API-NEXT PATCH 2/4] linux-gen: sched: use config
> max ordered locks
> 
> On 5 July 2017 at 01:35, Savolainen, Petri (Nokia - FI/Espoo)
> <petri.savolai...@nokia.com> wrote:
> >
> >> > diff --git a/platform/linux-generic/include/odp_config_internal.h
> >> b/platform/linux-generic/include/odp_config_internal.h
> >> > index 3cff0045..469396df 100644
> >> > --- a/platform/linux-generic/include/odp_config_internal.h
> >> > +++ b/platform/linux-generic/include/odp_config_internal.h
> >> > @@ -27,7 +27,7 @@
> >> >  /*
> >> >   * Maximum number of ordered locks per queue
> >> >   */
> >> > -#define CONFIG_QUEUE_MAX_ORD_LOCKS 4
> >> > +#define CONFIG_QUEUE_MAX_ORD_LOCKS 2
> >>
> >> This is unnecessary change for this patch. This patch does not need
> this
> >> change.
> >
> > With this value (2), the current situation does not change. Internal
> defines limited the number into 2, so this keeps it 2.
> 
> This change affects other implementations of the scheduler. If the
> default scheduler is implemented independent of what the value of
> CONFIG_QUEUE_MAX_ORD_LOCKS is, this change is not required.
> This change should not be necessary for this patch.

I try to keep properties as they were before the patch. I have not heard 
anybody complaining that 2 locks is not sufficient. Have you? We can later 
expand the value if needed. Your scheduler is not widely used yet (it's been in 
api-next a week or so), so people using this feature have not been exposed to 
number of locks being 4.

It was 2, I keep it 2 and we can increase it later if someone needs a larger 
value.

-Petri



Re: [lng-odp] [API-NEXT PATCH 2/4] linux-gen: sched: use config max ordered locks

2017-07-06 Thread Honnappa Nagarahalli
On 5 July 2017 at 01:35, Savolainen, Petri (Nokia - FI/Espoo)
 wrote:
>
>> > diff --git a/platform/linux-generic/include/odp_config_internal.h
>> b/platform/linux-generic/include/odp_config_internal.h
>> > index 3cff0045..469396df 100644
>> > --- a/platform/linux-generic/include/odp_config_internal.h
>> > +++ b/platform/linux-generic/include/odp_config_internal.h
>> > @@ -27,7 +27,7 @@
>> >  /*
>> >   * Maximum number of ordered locks per queue
>> >   */
>> > -#define CONFIG_QUEUE_MAX_ORD_LOCKS 4
>> > +#define CONFIG_QUEUE_MAX_ORD_LOCKS 2
>>
>> This is unnecessary change for this patch. This patch does not need this
>> change.
>
> With this value (2), the current situation does not change. Internal defines 
> limited the number into 2, so this keeps it 2.

This change affects other implementations of the scheduler. If the
default scheduler is implemented independent of what the value of
CONFIG_QUEUE_MAX_ORD_LOCKS is, this change is not required.
This change should not be necessary for this patch.

>
> -Petri


Re: [lng-odp] [API-NEXT PATCH 2/4] linux-gen: sched: use config max ordered locks

2017-07-05 Thread Savolainen, Petri (Nokia - FI/Espoo)

> > diff --git a/platform/linux-generic/include/odp_config_internal.h
> b/platform/linux-generic/include/odp_config_internal.h
> > index 3cff0045..469396df 100644
> > --- a/platform/linux-generic/include/odp_config_internal.h
> > +++ b/platform/linux-generic/include/odp_config_internal.h
> > @@ -27,7 +27,7 @@
> >  /*
> >   * Maximum number of ordered locks per queue
> >   */
> > -#define CONFIG_QUEUE_MAX_ORD_LOCKS 4
> > +#define CONFIG_QUEUE_MAX_ORD_LOCKS 2
> 
> This is unnecessary change for this patch. This patch does not need this
> change.

With this value (2), the current situation does not change. Internal defines 
limited the number into 2, so this keeps it 2.

-Petri


Re: [lng-odp] [API-NEXT PATCH 2/4] linux-gen: sched: use config max ordered locks

2017-07-04 Thread Honnappa Nagarahalli
On 30 June 2017 at 09:10, Petri Savolainen  wrote:
> Use config file value for the number of ordered locks
> everywhere.
>
> Signed-off-by: Petri Savolainen 
> ---
>  platform/linux-generic/include/odp_config_internal.h | 2 +-
>  platform/linux-generic/odp_schedule.c| 8 +---
>  platform/linux-generic/odp_schedule_iquery.c | 8 +---
>  3 files changed, 3 insertions(+), 15 deletions(-)
>
> diff --git a/platform/linux-generic/include/odp_config_internal.h 
> b/platform/linux-generic/include/odp_config_internal.h
> index 3cff0045..469396df 100644
> --- a/platform/linux-generic/include/odp_config_internal.h
> +++ b/platform/linux-generic/include/odp_config_internal.h
> @@ -27,7 +27,7 @@
>  /*
>   * Maximum number of ordered locks per queue
>   */
> -#define CONFIG_QUEUE_MAX_ORD_LOCKS 4
> +#define CONFIG_QUEUE_MAX_ORD_LOCKS 2

This is unnecessary change for this patch. This patch does not need this change.

>
>  /*
>   * Maximum number of packet IO resources
> diff --git a/platform/linux-generic/odp_schedule.c 
> b/platform/linux-generic/odp_schedule.c
> index 69de7ac0..53670a71 100644
> --- a/platform/linux-generic/odp_schedule.c
> +++ b/platform/linux-generic/odp_schedule.c
> @@ -121,12 +121,6 @@ ODP_STATIC_ASSERT((8 * sizeof(pri_mask_t)) >= 
> QUEUES_PER_PRIO,
>  /* Maximum number of dequeues */
>  #define MAX_DEQ CONFIG_BURST_SIZE
>
> -/* Maximum number of ordered locks per queue */
> -#define MAX_ORDERED_LOCKS_PER_QUEUE 2
> -
> -ODP_STATIC_ASSERT(MAX_ORDERED_LOCKS_PER_QUEUE <= CONFIG_QUEUE_MAX_ORD_LOCKS,
> - "Too_many_ordered_locks");
> -
>  /* Ordered stash size */
>  #define MAX_ORDERED_STASH 512
>
> @@ -449,7 +443,7 @@ static inline int grp_update_tbl(void)
>
>  static unsigned schedule_max_ordered_locks(void)
>  {
> -   return MAX_ORDERED_LOCKS_PER_QUEUE;
> +   return CONFIG_QUEUE_MAX_ORD_LOCKS;
>  }
>
>  static inline int queue_per_prio(uint32_t queue_index)
> diff --git a/platform/linux-generic/odp_schedule_iquery.c 
> b/platform/linux-generic/odp_schedule_iquery.c
> index 75f56e63..8d8dcc29 100644
> --- a/platform/linux-generic/odp_schedule_iquery.c
> +++ b/platform/linux-generic/odp_schedule_iquery.c
> @@ -148,12 +148,6 @@ typedef struct {
> odp_event_t stash[MAX_DEQ], *top;
>  } event_cache_t;
>
> -/* Maximum number of ordered locks per queue */
> -#define MAX_ORDERED_LOCKS_PER_QUEUE 2
> -
> -ODP_STATIC_ASSERT(MAX_ORDERED_LOCKS_PER_QUEUE <= CONFIG_QUEUE_MAX_ORD_LOCKS,
> - "Too_many_ordered_locks");
> -
>  /* Ordered stash size */
>  #define MAX_ORDERED_STASH 512
>
> @@ -1266,7 +1260,7 @@ static void schedule_order_unlock(unsigned lock_index)
>
>  static unsigned schedule_max_ordered_locks(void)
>  {
> -   return MAX_ORDERED_LOCKS_PER_QUEUE;
> +   return CONFIG_QUEUE_MAX_ORD_LOCKS;
>  }
>
>  static inline bool is_atomic_queue(unsigned int queue_index)
> --
> 2.13.0
>


[lng-odp] [API-NEXT PATCH 2/4] linux-gen: sched: use config max ordered locks

2017-06-30 Thread Petri Savolainen
Use config file value for the number of ordered locks
everywhere.

Signed-off-by: Petri Savolainen 
---
 platform/linux-generic/include/odp_config_internal.h | 2 +-
 platform/linux-generic/odp_schedule.c| 8 +---
 platform/linux-generic/odp_schedule_iquery.c | 8 +---
 3 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/platform/linux-generic/include/odp_config_internal.h 
b/platform/linux-generic/include/odp_config_internal.h
index 3cff0045..469396df 100644
--- a/platform/linux-generic/include/odp_config_internal.h
+++ b/platform/linux-generic/include/odp_config_internal.h
@@ -27,7 +27,7 @@
 /*
  * Maximum number of ordered locks per queue
  */
-#define CONFIG_QUEUE_MAX_ORD_LOCKS 4
+#define CONFIG_QUEUE_MAX_ORD_LOCKS 2
 
 /*
  * Maximum number of packet IO resources
diff --git a/platform/linux-generic/odp_schedule.c 
b/platform/linux-generic/odp_schedule.c
index 69de7ac0..53670a71 100644
--- a/platform/linux-generic/odp_schedule.c
+++ b/platform/linux-generic/odp_schedule.c
@@ -121,12 +121,6 @@ ODP_STATIC_ASSERT((8 * sizeof(pri_mask_t)) >= 
QUEUES_PER_PRIO,
 /* Maximum number of dequeues */
 #define MAX_DEQ CONFIG_BURST_SIZE
 
-/* Maximum number of ordered locks per queue */
-#define MAX_ORDERED_LOCKS_PER_QUEUE 2
-
-ODP_STATIC_ASSERT(MAX_ORDERED_LOCKS_PER_QUEUE <= CONFIG_QUEUE_MAX_ORD_LOCKS,
- "Too_many_ordered_locks");
-
 /* Ordered stash size */
 #define MAX_ORDERED_STASH 512
 
@@ -449,7 +443,7 @@ static inline int grp_update_tbl(void)
 
 static unsigned schedule_max_ordered_locks(void)
 {
-   return MAX_ORDERED_LOCKS_PER_QUEUE;
+   return CONFIG_QUEUE_MAX_ORD_LOCKS;
 }
 
 static inline int queue_per_prio(uint32_t queue_index)
diff --git a/platform/linux-generic/odp_schedule_iquery.c 
b/platform/linux-generic/odp_schedule_iquery.c
index 75f56e63..8d8dcc29 100644
--- a/platform/linux-generic/odp_schedule_iquery.c
+++ b/platform/linux-generic/odp_schedule_iquery.c
@@ -148,12 +148,6 @@ typedef struct {
odp_event_t stash[MAX_DEQ], *top;
 } event_cache_t;
 
-/* Maximum number of ordered locks per queue */
-#define MAX_ORDERED_LOCKS_PER_QUEUE 2
-
-ODP_STATIC_ASSERT(MAX_ORDERED_LOCKS_PER_QUEUE <= CONFIG_QUEUE_MAX_ORD_LOCKS,
- "Too_many_ordered_locks");
-
 /* Ordered stash size */
 #define MAX_ORDERED_STASH 512
 
@@ -1266,7 +1260,7 @@ static void schedule_order_unlock(unsigned lock_index)
 
 static unsigned schedule_max_ordered_locks(void)
 {
-   return MAX_ORDERED_LOCKS_PER_QUEUE;
+   return CONFIG_QUEUE_MAX_ORD_LOCKS;
 }
 
 static inline bool is_atomic_queue(unsigned int queue_index)
-- 
2.13.0