Re: Major SMP Improvements

2015-05-16 Thread Sebastian Huber


- Am 16. Mai 2015 um 8:49 schrieb Chris Johns chr...@rtems.org:

> On 16/05/2015 4:44 pm, Daniel Hellstrom wrote:
>> 
>> I thought this was publicaly known and that Sebastian's ticket was the
>> way to fix it. There was a discussion about it when it was discovered
>> around Aug 2014, and I agreed then that Sebastian's path to fixing it
>> sounded very good but I dont know all aspects of it. As I recall its not
>> a blocker for Leon smp, because of the dirty fix required for smp.
> 
> Thanks for clarifying things. I thought this was something else and new.

Sorry, I forgot to reference the corresponding ticket.  It is:

https://devel.rtems.org/ticket/2180
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH 05/45] score: Add header to _Watchdog_Remove()

2015-05-16 Thread Sebastian Huber


- Am 15. Mai 2015 um 20:07 schrieb Gedare Bloom ged...@rtems.org:

> On Fri, May 15, 2015 at 7:41 AM, Sebastian Huber
>  wrote:
[...]
>> diff --git a/cpukit/rtems/src/timercreate.c b/cpukit/rtems/src/timercreate.c
>> index 0b1c44b..390c965 100644
>> --- a/cpukit/rtems/src/timercreate.c
>> +++ b/cpukit/rtems/src/timercreate.c
>> @@ -25,6 +25,27 @@
>>  #include 
>>  #include 
>>
>> +void _Timer_Cancel( Timer_Control *the_timer )
>> +{
>> +  Timer_server_Control *timer_server;
>> +
>> +  switch ( the_timer->the_class ) {
>> +case TIMER_INTERVAL:
>> +  _Watchdog_Remove_ticks( &the_timer->Ticker );
>> +  break;
>> +case TIMER_TIME_OF_DAY:
>> +  _Watchdog_Remove_seconds( &the_timer->Ticker );
>> +  break;
>> +case TIMER_INTERVAL_ON_TASK:
>> +case TIMER_TIME_OF_DAY_ON_TASK:
>> +  timer_server = _Timer_server;
>> +  (*timer_server->cancel)( timer_server, the_timer );
>> +  break;
>> +default:
> Should this be an error case?

No, but I add an _Assert( the_timer->the_class == TIMER_DORMANT ).

> 
>> +  break;
>> +  }
>> +}
>> +
>>  rtems_status_code rtems_timer_create(
>>rtems_name  name,
>>rtems_id   *id
[...]
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH 34/45] score: Do not inline SMP lock if profiling enabled

2015-05-16 Thread Gedare Bloom
Not really related, but what is the "rule" for when we should use
RTEMS_INLINE_ROUTINE versus being able to say "static inline"?

-Gedare

On Fri, May 15, 2015 at 7:41 AM, Sebastian Huber
 wrote:
> This reduces the code size drastically.
> ---
>  cpukit/score/Makefile.am   |  1 +
>  cpukit/score/include/rtems/score/smplock.h | 57 -
>  cpukit/score/src/smplock.c | 68 
> ++
>  3 files changed, 125 insertions(+), 1 deletion(-)
>  create mode 100644 cpukit/score/src/smplock.c
>
> diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
> index cede673..714bd66 100644
> --- a/cpukit/score/Makefile.am
> +++ b/cpukit/score/Makefile.am
> @@ -138,6 +138,7 @@ libscore_a_SOURCES += src/schedulerprioritysmp.c
>  libscore_a_SOURCES += src/schedulersimplesmp.c
>  libscore_a_SOURCES += src/schedulersmpdebug.c
>  libscore_a_SOURCES += src/smp.c
> +libscore_a_SOURCES += src/smplock.c
>  libscore_a_SOURCES += src/smpmulticastaction.c
>  libscore_a_SOURCES += src/cpuset.c
>  libscore_a_SOURCES += src/cpusetprintsupport.c
> diff --git a/cpukit/score/include/rtems/score/smplock.h 
> b/cpukit/score/include/rtems/score/smplock.h
> index 5eb6ef3..50a0662 100644
> --- a/cpukit/score/include/rtems/score/smplock.h
> +++ b/cpukit/score/include/rtems/score/smplock.h
> @@ -10,7 +10,7 @@
>   * COPYRIGHT (c) 1989-2011.
>   * On-Line Applications Research Corporation (OAR).
>   *
> - * Copyright (c) 2013-2014 embedded brains GmbH
> + * Copyright (c) 2013-2015 embedded brains GmbH
>   *
>   * The license and distribution terms for this file may be
>   * found in the file LICENSE in this distribution or at
> @@ -32,6 +32,10 @@
>  #include 
>  #endif
>
> +#if defined( RTEMS_PROFILING )
> +#define RTEMS_SMP_LOCK_DO_NOT_INLINE
> +#endif
> +
>  #ifdef __cplusplus
>  extern "C" {
>  #endif /* __cplusplus */
> @@ -368,7 +372,16 @@ typedef struct {
>   * @param[in] name The name for the SMP lock statistics.  This name must be
>   * persistent throughout the life time of this statistics block.
>   */
> +#if defined( RTEMS_SMP_LOCK_DO_NOT_INLINE )
> +void _SMP_lock_Initialize(
> +  SMP_lock_Control *lock,
> +  const char *name
> +);
> +
> +static inline void _SMP_lock_Initialize_body(
> +#else
>  static inline void _SMP_lock_Initialize(
> +#endif
>SMP_lock_Control *lock,
>const char *name
>  )
> @@ -383,7 +396,13 @@ static inline void _SMP_lock_Initialize(
>   *
>   * @param[in,out] lock The SMP lock control.
>   */
> +#if defined( RTEMS_SMP_LOCK_DO_NOT_INLINE )
> +void _SMP_lock_Destroy( SMP_lock_Control *lock );
> +
> +static inline void _SMP_lock_Destroy_body( SMP_lock_Control *lock )
> +#else
>  static inline void _SMP_lock_Destroy( SMP_lock_Control *lock )
> +#endif
>  {
>_SMP_ticket_lock_Destroy( &lock->ticket_lock );
>  }
> @@ -399,7 +418,16 @@ static inline void _SMP_lock_Destroy( SMP_lock_Control 
> *lock )
>   * @param[in,out] context The local SMP lock context for an acquire and 
> release
>   * pair.
>   */
> +#if defined( RTEMS_SMP_LOCK_DO_NOT_INLINE )
> +void _SMP_lock_Acquire(
> +  SMP_lock_Control *lock,
> +  SMP_lock_Context *context
> +);
> +
> +static inline void _SMP_lock_Acquire_body(
> +#else
>  static inline void _SMP_lock_Acquire(
> +#endif
>SMP_lock_Control *lock,
>SMP_lock_Context *context
>  )
> @@ -415,7 +443,16 @@ static inline void _SMP_lock_Acquire(
>   * @param[in,out] context The local SMP lock context for an acquire and 
> release
>   * pair.
>   */
> +#if defined( RTEMS_SMP_LOCK_DO_NOT_INLINE )
> +void _SMP_lock_Release(
> +  SMP_lock_Control *lock,
> +  SMP_lock_Context *context
> +);
> +
> +static inline void _SMP_lock_Release_body(
> +#else
>  static inline void _SMP_lock_Release(
> +#endif
>SMP_lock_Control *lock,
>SMP_lock_Context *context
>  )
> @@ -431,7 +468,16 @@ static inline void _SMP_lock_Release(
>   * @param[in,out] context The local SMP lock context for an acquire and 
> release
>   * pair.
>   */
> +#if defined( RTEMS_SMP_LOCK_DO_NOT_INLINE )
> +void _SMP_lock_ISR_disable_and_acquire(
> +  SMP_lock_Control *lock,
> +  SMP_lock_Context *context
> +);
> +
> +static inline void _SMP_lock_ISR_disable_and_acquire_body(
> +#else
>  static inline void _SMP_lock_ISR_disable_and_acquire(
> +#endif
>SMP_lock_Control *lock,
>SMP_lock_Context *context
>  )
> @@ -447,7 +493,16 @@ static inline void _SMP_lock_ISR_disable_and_acquire(
>   * @param[in,out] context The local SMP lock context for an acquire and 
> release
>   * pair.
>   */
> +#if defined( RTEMS_SMP_LOCK_DO_NOT_INLINE )
> +void _SMP_lock_Release_and_ISR_enable(
> +  SMP_lock_Control *lock,
> +  SMP_lock_Context *context
> +);
> +
> +static inline void _SMP_lock_Release_and_ISR_enable_body(
> +#else
>  static inline void _SMP_lock_Release_and_ISR_enable(
> +#endif
>SMP_lock_Control *lock,
>SMP_lock_Context *context
>  )
> diff --git a/cpukit/score/src/smplock.c b/cpukit/score/src/smplock.c
> new file mode 100644
> ind

Re: [PATCH 37/45] psxualarm: Avoid endless signal handling

2015-05-16 Thread Gedare Bloom
On Fri, May 15, 2015 at 7:41 AM, Sebastian Huber
 wrote:
> Increase the ualarm timer interval to avoid endless signal handling.
> ---
>  testsuites/psxtests/psxualarm/init.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/testsuites/psxtests/psxualarm/init.c 
> b/testsuites/psxtests/psxualarm/init.c
> index 03e03b9..0526c23 100644
> --- a/testsuites/psxtests/psxualarm/init.c
> +++ b/testsuites/psxtests/psxualarm/init.c
> @@ -88,7 +88,7 @@ void *POSIX_Init(
>sigaction( SIGALRM, &act, NULL );
>puts( "Init: ualarm in 1 us" );
Change print message to correspond

>sleep(3);
> -  result = ualarm(1,0);
> +  result = ualarm(10,0);
>rtems_test_assert( result == 0 );
>
>status = sleep(10);
> --
> 1.8.4.5
>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH 09/45] score: New timer server implementation

2015-05-16 Thread Gedare Bloom
> -/* FIXME: This locking approach for SMP is improvable! */
> +  ++watchdogs->generation;
>
We should probably try to file a ticket associated with any FIXME type
comments, and refer to it in the FIXME too.
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel