Commit Graph

84 Commits

Author SHA1 Message Date
Sebastian Huber
9486566ca8 smptests/smpload01: Improve test
Add a task producing memory traffic.  Add tasks to obtain a priority
inheritance semaphore in a synchronized way.
2014-03-21 10:52:21 +01:00
Chris Johns
c49985691f Change all references of rtems.com to rtems.org. 2014-03-21 08:10:47 +11:00
Sebastian Huber
65c0166faf smptests/smpload01: Use test extension 2014-03-17 13:21:15 +01:00
Sebastian Huber
ad48ebbfc7 tests/smptests: Use <rtems/test.h> 2014-03-17 09:17:36 +01:00
Sebastian Huber
4575ae0a40 smptests/smpload01: New test 2014-03-14 08:46:50 +01:00
Sebastian Huber
53ad908a64 score: Add SMP lock profiling support 2014-03-14 08:46:49 +01:00
Sebastian Huber
28779c70ff score: Add function to destroy SMP locks 2014-03-11 10:58:09 +01:00
Sebastian Huber
d50acdbb6c score: Add local context to SMP lock API
Add a local context structure to the SMP lock API for acquire and
release pairs.  This context can be used to store the ISR level and
profiling information.  It may be later used to enable more
sophisticated lock algorithms, e.g. MCS locks.

There is only one lock that cannot be used with a local context.  This
is the per-CPU lock since here we would have to transfer the local
context through a context switch which is very complicated.
2014-03-11 10:58:09 +01:00
Sebastian Huber
909f61b14a smptests/smppsxaffinity02: Fix end of test message 2014-03-10 13:28:53 +01:00
Jennifer Averett
5c3323492e Remove trailing whitespace in previous patches 2014-03-07 09:15:15 -06:00
Jennifer Averett
2ef0328958 smptests: Add smppsxaffinity02.
This method exercises the ability to dynamically get and set
the affinity of POSIX threads.

NOTE: There is no scheduler support for affinity. This is
simply a data integrity test.
2014-03-07 09:14:33 -06:00
Jennifer Averett
f3e6b18a4a smptests: Add smppsxaffinity01.
This test exercises the ability to obtain and modify
the affinity field of the POSIX thread attributes.
2014-03-07 09:13:35 -06:00
Jennifer Averett
a3e055fe8a smptests: Add smpaffinity01
This test exercises the new Classic API task affinity methods.
2014-03-07 09:13:14 -06:00
Sebastian Huber
e5bcb24bd0 smptests: Delete config.h.in 2014-03-06 11:16:57 +01:00
Sebastian Huber
8b50a55001 score: Add _Atomic_Fence() 2014-03-06 09:43:58 +01:00
Sebastian Huber
ba25cc208c score: Add and use _Giant_Drop()
New test smptests/smpfatal03.
2014-03-06 09:43:58 +01:00
Sebastian Huber
7336be9d78 score: SMP initialization and shutdown changes
Rename _SMP_Request_other_cores_to_perform_first_context_switch() into
_SMP_Request_start_multitasking() since this requests now a multitasking
start on all configured and available processors.  The name corresponds
_Thread_Start_multitasking() and
_SMP_Start_multitasking_on_secondary_processor() actions issued in
response to this request.  Move in source file to right place.

Rename PER_CPU_STATE_READY_TO_BEGIN_MULTITASKING into
PER_CPU_STATE_READY_TO_START_MULTITASKING.

Rename PER_CPU_STATE_BEGIN_MULTITASKING into
PER_CPU_STATE_REQUEST_START_MULTITASKING.

Rename _SMP_Request_other_cores_to_shutdown() into
_SMP_Request_shutdown().

Add a per-CPU state lock to protect all changes.  This was necessary to
offer a controlled shutdown of the system (atomic read/writes alone are
not sufficient for this kind of synchronization).

Add documentation for Per_CPU_State.

Delete debug output.

New tests smptests/smpfatal01 and smptests/smpfatal02.
2014-03-06 09:43:57 +01:00
Sebastian Huber
47d6013417 score: _CPU_SMP_Get_current_processor()
Remove RTEMS_COMPILER_PURE_ATTRIBUTE from _SMP_Get_current_processor()
and all _CPU_SMP_Get_current_processor().  Make inline ASM statements
volatile again.  Test smptests/smpmigration01 showed that GCC optimizes
too much otherwise.
2014-02-21 09:38:54 +01:00
Jennifer Averett
2729c1c2a8 smptests: Add check for affinity support in newlib. 2014-02-17 12:19:06 -06:00
Sebastian Huber
ad7292f264 score: Add SMP barrier 2014-02-17 08:46:38 +01:00
Sebastian Huber
7d066fc23f smptests/smplock01: Use atomic operations 2014-02-17 08:46:38 +01:00
Sebastian Huber
8a9568d2e7 Require presence of <stdatomic.h> for SMP support 2014-02-17 08:46:38 +01:00
Sebastian Huber
945853b7cf score: Add Atomic_Uint 2014-02-14 10:28:30 +01:00
Sebastian Huber
7eb6444d08 smptests/smp06: Delete test
This test referred to the first version of the simple SMP scheduler
which used the thread execution time for its scheduling decisions.  For
the current simple SMP scheduler, the execution time of threads is
irrelevant (like in the corresponding single-processor variant).
2013-11-11 10:29:36 +01:00
WeiY
33e18a4f4e rename smpatomic08 to smpatomic01 2013-10-08 16:07:22 +02:00
WeiY
27a034ef13 delete smpatomic0-7 test cases 2013-10-08 16:07:21 +02:00
WeiY
fee154be37 add simple atomic test cases into smpatomic08 2013-10-08 16:06:59 +02:00
Sebastian Huber
4a8c334fb2 smptests/smpatomic08: Add initialization test case 2013-09-03 11:07:37 +02:00
Sebastian Huber
29f7d31782 score: Use unsigned long for atomic integers
Use unsigned long instead of uint_fast32_t since C11 provides only a
ATOMIC_LONG_LOCK_FREE macro constant.  This makes it also possible to
use properly typed integer literals like 123UL.  It is now clear which
compatible type should be used for the atomic integer.
2013-09-03 11:07:36 +02:00
Sebastian Huber
47b6fad012 smptests/smpatomic08: Avoid copy and paste 2013-09-01 15:18:11 +02:00
Sebastian Huber
7136d7f1af smptests/smpatomic08: Simplify or/and test case
Renamed and use common integer variables.
2013-09-01 15:17:02 +02:00
Sebastian Huber
d39ccd69f1 smptests/smpatomic08: Fix compare and exchange 2013-09-01 15:17:01 +02:00
WeiY
4238affc5f add atomic sub, and, or, compare_exchange test cases into smpatomic08 2013-09-01 15:17:01 +02:00
Sebastian Huber
e127c4c9ea smptests/smpatomic08: Fix race conditions 2013-08-29 10:05:16 +02:00
Sebastian Huber
79d03e30bf smptests/smpatomic08: New test 2013-08-28 14:58:51 +02:00
Sebastian Huber
2bbcb644f9 smptests: Move ATOMIC conditional to top-level 2013-08-28 14:58:50 +02:00
Sebastian Huber
518d82b6d3 smp: Disable restart of threads other than self 2013-08-20 11:03:38 +02:00
Sebastian Huber
99b35052ae smp: Add Deterministic Priority SMP Scheduler 2013-08-20 10:17:35 +02:00
Sebastian Huber
aea4a91993 smp: Optimize Simple SMP scheduler
Add Thread_Control::is_in_the_air field if configured for SMP.  This
helps to simplify the extract operation and avoids superfluous
inter-processor interrupts.  Move the processor allocation step into the
enqueue operation.

Add and use _Scheduler_simple_smp_Get_highest_ready().  Add and use
_Scheduler_SMP_Get_lowest_scheduled().
2013-08-20 10:14:04 +02:00
WeiY
6931037e1d correct memory model in smpatomic test case 2013-08-19 14:35:38 +02:00
Sebastian Huber
806f84c8ee smptests/smpswitchextension01: Fix start sequence
Start the toggler after the context is initialized.
2013-08-09 23:02:45 +02:00
Sebastian Huber
d19cce29dc score: Per-CPU thread dispatch disable level
Use a per-CPU thread dispatch disable level.  So instead of one global
thread dispatch disable level we have now one instance per processor.
This is a major performance improvement for SMP.  On non-SMP
configurations this may simplifiy the interrupt entry/exit code.

The giant lock is still present, but it is now decoupled from the thread
dispatching in _Thread_Dispatch(), _Thread_Handler(),
_Thread_Restart_self() and the interrupt entry/exit.   Access to the
giant lock is now available via _Giant_Acquire() and _Giant_Release().
The giant lock is still implicitly acquired via
_Thread_Dispatch_decrement_disable_level().

The giant lock is only acquired for high-level operations in interrupt
handlers (e.g. release of a semaphore, sending of an event).

As a side-effect this change fixes the lost thread dispatch necessary
indication bug in _Thread_Dispatch().

A per-CPU thread dispatch disable level greatly simplifies the SMP
support for the interrupt entry/exit code since no spin locks have to be
acquired in this area.  It is only necessary to get the current
processor index and use this to calculate the address of the own per-CPU
control.  This reduces the interrupt latency considerably.

All elements for the interrupt entry/exit code are now part of the
Per_CPU_Control structure: thread dispatch disable level, ISR nest level
and thread dispatch necessary.  Nothing else is required (except CPU
port specific stuff like on SPARC).
2013-08-09 23:02:38 +02:00
Sebastian Huber
c8670f50d7 smptests/smpmigration01: Fix start sequence
Start the runner after the context is initialized.
2013-08-08 14:11:23 +02:00
Sebastian Huber
015bd1b818 smptests/smp07: Use suspend instead of delete 2013-08-06 11:03:11 +02:00
Sebastian Huber
20bb89d3eb smptests/smpswitchextension01: New test 2013-08-05 13:45:37 +02:00
Sebastian Huber
b9000fd571 smptests/smpmigration01: New test 2013-08-05 13:45:36 +02:00
Sebastian Huber
876dcd02e0 smptests/smppsxsignal01: New test 2013-07-30 09:53:24 +02:00
Sebastian Huber
d4f13d1479 smptests/smpsignal01: New test 2013-07-30 09:53:24 +02:00
Sebastian Huber
fe52e7c07c smp: Add and use _Per_CPU_Get()
Add and use _Per_CPU_Get_by_index() and _Per_CPU_Get_index().  Add
_Per_CPU_Send_interrupt().  This avoids direct access of
_Per_CPU_Information.
2013-07-30 09:53:23 +02:00
Sebastian Huber
d8dd80e8a6 smptests/smp08: Print missing newline 2013-07-22 16:57:22 +02:00