Commit Graph

353 Commits

Author SHA1 Message Date
Sebastian Huber
436a4b384b smptests/smpsignal01: Check signal ISR level
Close #2751.
2017-01-24 09:44:02 +01:00
Joel Sherrill
7a4b264574 Remove obsolete __RTEMS_HAVE_SYS_CPUSET_H__ 2017-01-11 09:45:32 -06:00
Sebastian Huber
6a9282d9bb Rename is_internal to always_set_to_false
Update #2825.
2016-12-12 08:03:14 +01:00
Sebastian Huber
ccda60bdb6 smplock01: Fix plot scripts 2016-12-07 11:22:00 +01:00
Sebastian Huber
38bc13f809 smplock01: Fix fairness plot script 2016-12-05 14:47:19 +01:00
Sebastian Huber
b07e642a2b smpthreadlife01: Fix due to robust thread dispatch
Update #2811.
2016-12-02 13:56:04 +01:00
Sebastian Huber
5b6c290ed0 score: Initialize thread queue context early
Initialize thread queue context early preferably outside the critical
section.

Remove implicit _Thread_queue_Context_initialize() from
_Thread_Wait_acquire().
2016-12-02 12:41:03 +01:00
Sebastian Huber
c09db57f37 score: Fix thread queue context initialization
Initialize the thread queue context with invalid data in debug
configurations to catch missing set up steps.
2016-11-28 16:08:43 +01:00
Sebastian Huber
73f9c2c27b smptests/smpfatal03: Use timer to provoke error
Avoid use of internal _Thread_Dispatch_disable() function.

Update #2825.
2016-11-23 13:44:22 +01:00
Sebastian Huber
84e6f15c82 score: Robust thread dispatch
On SMP configurations, it is a fatal error to call blocking operating
system with interrupts disabled, since this prevents delivery of
inter-processor interrupts. This could lead to executing threads which
are not allowed to execute resulting in undefined behaviour.

The ARM Cortex-M port has a similar problem, since the interrupt state
is not a part of the thread context.

Update #2811.
2016-11-23 12:52:06 +01:00
Sebastian Huber
a6283671f3 smptests/smplock01: Test TAS and TTAS locks
Cache align locks in the context.
2016-11-23 12:52:05 +01:00
Sebastian Huber
db20706d5a smptests/smpscheduler02: Fix task initialization
Set scheduler before the task start.
2016-11-23 12:52:05 +01:00
Sebastian Huber
537f00ebe8 score: Restrict task interrupt level to 0 on SMP
Update #2811.
2016-11-18 07:30:35 +01:00
Sebastian Huber
38a1449fd4 powerpc: Add _CPU_Get_current_per_CPU_control()
Add _CPU_Get_current_per_CPU_control() on SMP configurations.  Use SPRG0
for the current per-CPU control.  This reduces the code size by three
instructions and is slightly faster.

Update #2805.
2016-11-10 09:58:37 +01:00
Sebastian Huber
05ca53ddf6 rtems: Add scheduler processor add/remove
Update #2797.
2016-11-10 09:22:09 +01:00
Sebastian Huber
2612a0bf5b score: Simplify _Scheduler_Get_by_id()
Avoid dead code in non-SMP configurations.  Return scheduler identifier
independent of the current processor count of the scheduler via
rtems_scheduler_ident(), since this value may change during run-time.
Check the processor count in _Scheduler_Set() under scheduler lock
protection.

Update #2797.
2016-11-09 15:27:29 +01:00
Sebastian Huber
eb98dd49bc score: Inline some SMP lock operations by default
The SMP ticket lock release turned out to be suitable for inlining, e.g.
a hand full of instructions, no branches.

The changes in the screen files do not reflect the changes due to this
commit.  However, they are now up to date.  Obtained on a T4240 running
at 1.5GHz using GCC 7.0.0 20161108..
2016-11-09 15:19:59 +01:00
Sebastian Huber
9e7fa07169 score: Relax _Scheduler_Set() restrictions
No longer unconditionally prevent scheduler changes if the thread owns
resources.  Prevent a scheduler change only in case other threads wait
for the resource.
2016-11-03 11:19:34 +01:00
Sebastian Huber
d505fbbd31 smptests/smplock01: Update screen file 2016-11-03 10:02:39 +01:00
Sebastian Huber
63e2ca1b8b score: Simplify yield and unblock scheduler ops
Update #2556.
2016-11-02 10:05:45 +01:00
Sebastian Huber
2dd098a635 score: Introduce Thread_Scheduler_control::home
Replace Thread_Scheduler_control::control and
Thread_Scheduler_control::own_control with new
Thread_Scheduler_control::home.

Update #2556.
2016-11-02 10:05:45 +01:00
Sebastian Huber
6771359fa1 score: Second part of new MrsP implementation
Update #2556.
2016-11-02 10:05:44 +01:00
Sebastian Huber
9c238e1bd4 score: Simplify update priority scheduler op
Remove unused return status.
2016-11-02 10:05:44 +01:00
Sebastian Huber
3a27248054 score: First part of new MrsP implementation
Update #2556.
2016-11-02 10:05:43 +01:00
Sebastian Huber
6a82f1ae8c score: Yield support for new SMP helping protocol
Update #2556.
2016-11-02 10:05:43 +01:00
Sebastian Huber
351c14dfd0 score: Add new SMP scheduler helping protocol
Update #2556.
2016-11-02 10:05:43 +01:00
Sebastian Huber
72e0bdba45 score: Pass scheduler node to unblock operation
Changed for consistency with other scheduler operations.

Update #2556.
2016-11-02 10:05:41 +01:00
Sebastian Huber
e382a1bfcc score: Pass scheduler node to block operation
Changed for consistency with other scheduler operations.

Update #2556.
2016-11-02 10:05:41 +01:00
Sebastian Huber
2df4abcee2 score: Pass scheduler node to yield operation
Changed for consistency with other scheduler operations.

Update #2556.
2016-11-02 10:05:40 +01:00
Sebastian Huber
501043a18b score: Pass scheduler node to update priority op
This enables to call this scheduler operation for all scheduler nodes
available to a thread.

Update #2556.
2016-11-02 10:05:40 +01:00
Sebastian Huber
7eec247c35 smptests/smplock01: Use test support
Convert output to XML.
2016-10-31 13:09:42 +01:00
Sebastian Huber
ed19002d84 smpschedaffinity05: Fix configuration 2016-10-12 10:37:23 +02:00
Sebastian Huber
f6142c19f1 score: Scheduler node awareness for thread queues
Maintain the priority of a thread for each scheduler instance via the
thread queue enqueue, extract, priority actions and surrender
operations.  This replaces the primitive priority boosting.

Update #2556.
2016-09-21 08:59:33 +02:00
Sebastian Huber
8123cae864 rtems: Add rtems_task_get_priority()
Update #2556.
Update #2784.
2016-09-21 08:59:33 +02:00
Sebastian Huber
6ae309ec85 smptests/smpmutex01: Use test case functions 2016-09-21 08:59:33 +02:00
Sebastian Huber
300f6a481a score: Rework thread priority management
Add priority nodes which contribute to the overall thread priority.

The actual priority of a thread is now an aggregation of priority nodes.
The thread priority aggregation for the home scheduler instance of a
thread consists of at least one priority node, which is normally the
real priority of the thread.  The locking protocols (e.g. priority
ceiling and priority inheritance), rate-monotonic period objects and the
POSIX sporadic server add, change and remove priority nodes.

A thread changes its priority now immediately, e.g. priority changes are
not deferred until the thread releases its last resource.

Replace the _Thread_Change_priority() function with

 * _Thread_Priority_perform_actions(),
 * _Thread_Priority_add(),
 * _Thread_Priority_remove(),
 * _Thread_Priority_change(), and
 * _Thread_Priority_update().

Update #2412.
Update #2556.
2016-09-21 08:59:26 +02:00
Sebastian Huber
b20b736382 score: Introduce _Thread_Get_priority()
Avoid direct access to thread internal data fields.
2016-09-08 09:55:28 +02:00
Chris Johns
1c18ebf0d6 libmisc/capture: Remove the reserved _t in the types. 2016-09-01 11:11:45 +10:00
Chris Johns
6da06c559f libmisc/capture: Fix the capture engine on SMP.
This patches some issues with the capture engine:

 1. Check is the engine is open in ctrace commands.
 2. Check all record open and appends for overflow.
 3. Fix the record open to take the size of user data and
    not the record header.
 4. Use packed structs for data being written to the per
    cpu buffers.
 5. Remove direct struct access to the capture buffers to
    avoid misaligned accesses.
 6. Add support to extract records, no struct access to the
    capture buffers.
 7. Update ctrace to extract records from the capture buffers.
 8. Add support to ctrace to always print the task name if it
    has one.
 9. Add support to manage names or the lack of a name.
10. Range of minor fixes.
11. Fix a long standing bug in ctset's handling of args.

Closes #2780.
2016-09-01 11:11:22 +10:00
Sebastian Huber
57a00bc6af smptests/smpmutex02: New test
Update #2765.
2016-07-25 14:18:34 +02:00
Sebastian Huber
6f6cf78501 score: Postpone SMP shutdown in _Terminate()
This enables fatal extensions to continue program execution after some
fatal errors.
2016-07-06 09:33:32 +02:00
Sebastian Huber
c0bd0064ac rtems: Fix rtems_task_set_scheduler() API
Task priorities are only valid within a scheduler instance. The
rtems_task_set_scheduler() directive moves a task from one scheduler
instance to another using the current priority of the thread. However,
the current task priority of the source scheduler instance is undefined
in the target scheduler instance. Add a third parameter to specify the
priority.

Close #2749.
2016-07-01 11:51:49 +02:00
Sebastian Huber
4280dff7cf smptests/smpstrongapa01: Simplify 2016-06-30 11:01:05 +02:00
Sebastian Huber
4fe0e97f91 smptests/smpstrongapa01: Add test cases 2016-06-30 09:54:41 +02:00
Sebastian Huber
254dc82daf score: Change Priority_Control to 64-bit
A 32-bit Priority_Control limits the uptime to 49 days with a 1ms clock
tick in case the EDF scheduler is used.  Increase it to 64-bit to enable
proper operation of the EDF scheduler,

Close 2173.
2016-06-24 14:44:31 +02:00
Sebastian Huber
ec5d95e15e smptests/smpmrsp01: Fix due to API changes
Commit 77ff5599e0 introduced a change in
the rtems_semaphore_create() behaviour for MrsP semaphores.  The ceiling
priorities for all schedulers except the scheduler of the executing
thread are initialized to zero.
2016-06-23 10:36:22 +02:00
Sebastian Huber
9bfad8cd51 score: Add thread priority to scheduler nodes
The thread priority is manifest in two independent areas.  One area is
the user visible thread priority along with a potential thread queue.
The other is the scheduler.  Currently, a thread priority update via
_Thread_Change_priority() first updates the user visble thread priority
and the thread queue, then the scheduler is notified if necessary.  The
priority is passed to the scheduler via a local variable.  A generation
counter ensures that the scheduler discards out-of-date priorities.

This use of a local variable ties the update in these two areas close
together.  For later enhancements and the OMIP locking protocol
implementation we need more flexibility.  Add a thread priority
information block to Scheduler_Node and synchronize priority value
updates via a sequence lock on SMP configurations.

Update #2556.
2016-06-22 14:44:56 +02:00
Sebastian Huber
77ff5599e0 score: Introduce map priority scheduler operation
Introduce map/unmap priority scheduler operations to map thread priority
values from/to the user domain to/from the scheduler domain.  Use the
map priority operation to validate the thread priority.  The EDF
schedulers use this new operation to distinguish between normal
priorities and priorities obtain through a job release.

Update #2173.
Update #2556.
2016-06-22 14:36:40 +02:00
Sebastian Huber
6a631daeb8 posix: sched_get_priority_max()
Enable for all configurations since it pulls in no additional
dependencies.  Return value of the scheduler instance of the executing
thread.
2016-06-14 11:58:03 +02:00
Sebastian Huber
ea02782abc posix: sched_get_priority_min()
Enable for all configurations since it pulls in no additional
dependencies.
2016-06-14 11:58:02 +02:00