| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Avoid direct access to thread internal data fields.
|
|
|
|
|
|
| |
Introduce Thread_queue_Lock_context to contain the context necessary for
thread queue lock and thread wait lock acquire/release operations to
reduce the Thread_Control size.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
The _Thread_Lock_acquire() function had a potentially infinite run-time
due to the lack of fairness at atomic operations level.
Update #2412.
Update #2556.
Update #2765.
|
|
|
|
|
|
|
|
|
| |
Clock disciplines may be WATCHDOG_RELATIVE, WATCHDOG_ABSOLUTE,
or WATCHDOG_NO_TIMEOUT. A discipline of WATCHDOG_RELATIVE with
a timeout of WATCHDOG_NO_TIMEOUT is equivalent to a discipline
of WATCHDOG_NO_TIMEOUT.
updates #2732
|
|
|
|
|
|
| |
Provide the scheduler node to initialize or destroy to the corresponding
operations. This makes it possible to have more than one scheduler node
per thread.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The ARM and PowerPC interrupt epilogues call _Thread_Dispatch() with
interrupts disabled (counter example: SPARC).
On SMP configurations, since inter-processor interrupts set the thread
dispatch necessary indicator this prevents a thread dispatch
notification in post-switch handlers (which all run with interrupts
disabled).
On all configurations, this is a serious issue for the interrupt
latency.
Update #2751
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Move the safety check performed by
_CORE_mutex_Check_dispatch_for_seize() out of the performance critical
path and generalize it. Blocking on a thread queue with an unexpected
thread dispatch disabled level is illegal in all system states.
Add the expected thread dispatch disable level (which may be 1 or 2
depending on the operation) to Thread_queue_Context and use it in
_Thread_queue_Enqueue_critical().
|
|
|
|
|
|
| |
Add _Thread_queue_Context_set_MP_callout() to simplify
_Thread_queue_Context_initialize(). This makes it possible to more
easily add additional fields to Thread_queue_Context.
|
|
|
|
|
|
|
|
|
|
|
| |
Unify the status codes of the Classic and POSIX API to use the new enum
Status_Control. This eliminates the Thread_Control::Wait::timeout_code
field and the timeout parameter of _Thread_queue_Enqueue_critical() and
_MPCI_Send_request_packet(). It gets rid of the status code translation
tables and instead uses simple bit operations to get the status for a
particular API. This enables translation of status code constants at
compile time. Add _Thread_Wait_get_status() to avoid direct access of
thread internal data structures.
|
|
|
|
|
|
|
|
| |
Drop the multiprocessing (MP) dependent callout parameter from the
thread queue extract, dequeue, flush and unblock methods. Merge this
parameter with the lock context into new structure Thread_queue_Context.
This helps to gets rid of the conditionally compiled method call
helpers.
|
|
|
|
|
| |
Get rid of the mp_id parameter used for some thread queue methods. Use
THREAD_QUEUE_QUEUE_TO_OBJECT() instead.
|
|
|
|
|
|
|
|
| |
Add Thread_Life_state::THREAD_LIFE_CHANGE_DEFERRED and rework the POSIX
thread cancellation to use the thread life states.
Update #2555.
Update #2626.
|
|
|
|
|
|
|
|
|
| |
Rework pthread_join() to use _Thread_Join().
Close #2402.
Update #2555.
Update #2626.
Close #2714.
|
|
|
|
|
|
|
|
| |
Use _Thread_Change_life_locked() to avoid duplicated code. Avoid Giant
lock in _Thread_Life_action_handler().
Update #2555.
Update #2626.
|
|
|
|
|
|
|
| |
Rework _Thread_Cancel() to use _Thread_Change_life_locked().
Update #2555.
Update #2626.
|
|
|
|
|
|
|
|
|
| |
Rework _Thread_Restart_other() to use _Thread_Change_life_locked().
Cope with concurrent change requests by means of a pending request
counter.
Update #2555.
Update #2626.
|
|
|
|
|
|
|
|
|
|
|
| |
Split _Thread_Restart() into _Thread_Restart_self() and
_Thread_Restart_other(). Move content of existing
_Thread_Restart_self() into new _Thread_Restart_self(). Avoid Giant
lock for thread restart. _Thread_Restart_self() is a no-return function
and used by _Thread_Global_construction().
Update #2555.
Update #2626.
|
|
|
|
|
|
|
|
| |
Split _Thread_Close() into _Thread_Join() and _Thread_Cancel() to
prepare for a re-use in pthread_join() and pthread_cancel().
Update #2555.
Update #2626.
|
|
|
|
|
|
|
| |
Rework _Thread_Exit() to use _Thread_Change_life_locked().
Update #2555.
Update #2626.
|
|
|
|
|
| |
Update #2555.
Update #2626.
|
|
|
|
|
|
|
|
|
| |
Add _Thread_Change_life_locked() as a general function to alter the
thread life state. Use it to implement _Thread_Set_life_protection() as
a first step.
Update #2555.
Update #2626.
|
|
|
|
|
| |
Update #2555.
Update #2626.
|
|
|
|
|
|
|
|
| |
Disable thread dispatching is enough to prevent deletion of the
executing thread. There is no need for an additional life protection.
Update #2555.
Update #2626.
|
|
|
|
|
|
|
|
| |
The goal is to make _Thread_Exit() a no-return function in follow up
patches.
Update #2555.
Update #2626.
|
|
|
|
| |
Update #2556.
|
|
|
|
|
|
|
|
|
|
|
| |
Add a lock and use a chain iterator for safe iteration during concurrent
user extension addition and removal.
Ensure that dynamically added thread delete and fatal extensions are
called in reverse order.
Update #2555.
Update #2692.
|
| |
|
|
|
|
|
|
| |
Yields higher performance on SMP systems.
Close #2625.
|
|
|
|
| |
Update #2554.
|
|
|
|
|
|
|
|
|
| |
Use a red-black tree instead of delta chains.
Close #2344.
Update #2554.
Update #2555.
Close #2606.
|
|
|
|
|
|
|
| |
This avoids potential dead code in _Thread_Handler(). It gets rid of
the dangerous function pointer casts.
Update #2514.
|
|
|
|
|
|
|
| |
Remove the thread action handler parameter from
_Thread_Action_initialize() and instead set it later in
_Thread_Add_post_switch_action(). This avoids a dependency on the
thread action handler via the thread initialization.
|
|
|
|
|
|
| |
This enables external libraries to use thread locks since they are
independent of the actual RTEMS build configuration, e.g. profiling
enabled or disabled.
|
|
|
|
|
|
|
| |
These SMP lock statistics are used for all lock objects that lack a
storage space for the statistics. Examples are lock objects used in
external libraries which are independent of the actual RTEMS build
configuration.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the storage for the thread queue heads to the threads. Each thread
provides a set of thread queue heads allocated from a dedicated memory
pool. In case a thread blocks on a queue, then it lends its heads to
the queue. In case the thread unblocks, then it takes a free set of
threads from the queue. Since a thread can block on at most one queue
this works. This mechanism is used in FreeBSD. The motivation for this
change is to reduce the memory demands of the synchronization objects.
On a 32-bit uni-processor configuration the Thread_queue_Control size is
now 8 bytes, compared to 64 bytes in RTEMS 4.10 (other changes reduced
the size as well).
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the writes to Thread_Control::current_priority and
Thread_Control::real_priority into _Thread_Change_priority() under the
protection of the thread lock. Add a filter function to
_Thread_Change_priority() to enable specialized variants.
Avoid race conditions during a thread priority restore with the new
Thread_Control::priority_restore_hint for an important average case
optimizations used by priority inheritance mutexes.
Update #2273.
|
|
|
|
|
|
|
|
| |
Add watchdog header parameter to _Watchdog_Remove() to be in line with
the other operations. Add _Watchdog_Remove_ticks() and
_Watchdog_Remove_seconds() for convenience.
Update #2307.
|
|
|
|
| |
Update #2273.
|
|
|
|
|
|
|
| |
Deliver the POSIX signals after the thread state was updated to avoid
race-conditions on SMP configurations.
Update #2273.
|
|
|
|
|
|
| |
Close the thread object in _Thread_Make_zombie() so that all blocking
operations that use _Thread_Get() in the corresponding release directive
can find a terminating thread and can complete the operation.
|
|
|
|
|
|
|
|
| |
Replace _Scheduler_Allocate() with _Scheduler_Node_initialize(). Remove
the return status and thus the node initialization must be always
successful.
Rename _Scheduler_Free() to _Scheduler_Node_destroy().
|
| |
|
|
|
|
|
|
|
| |
Enable usage of _Thread_Set_life_protection() in thread dispatch
critical sections. This can be used to enable the thread
life-protection with thread dispatching disabled and then enable thread
dispatching.
|
|
|
|
| |
Use separate state for thread restart.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current implementation of task migration in RTEMS has some
implications with respect to the interrupt latency. It is crucial to
preserve the system invariant that a task can execute on at most one
processor in the system at a time. This is accomplished with a boolean
indicator in the task context. The processor architecture specific
low-level task context switch code will mark that a task context is no
longer executing and waits that the heir context stopped execution
before it restores the heir context and resumes execution of the heir
task. So there is one point in time in which a processor is without a
task. This is essential to avoid cyclic dependencies in case multiple
tasks migrate at once. Otherwise some supervising entity is necessary to
prevent life-locks. Such a global supervisor would lead to scalability
problems so this approach is not used. Currently the thread dispatch is
performed with interrupts disabled. So in case the heir task is
currently executing on another processor then this prolongs the time of
disabled interrupts since one processor has to wait for another
processor to make progress.
It is difficult to avoid this issue with the interrupt latency since
interrupts normally store the context of the interrupted task on its
stack. In case a task is marked as not executing we must not use its
task stack to store such an interrupt context. We cannot use the heir
stack before it stopped execution on another processor. So if we enable
interrupts during this transition we have to provide an alternative task
independent stack for this time frame. This issue needs further
investigation.
|
|
|
|
|
|
|
|
|
|
|
| |
The thread control block contains fields that point to application
configuration dependent memory areas, like the scheduler information,
the API control blocks, the user extension context table, the RTEMS
notepads and the Newlib re-entrancy support. Account for these areas in
the configuration and avoid extra workspace allocations for these areas.
This helps also to avoid heap fragementation and reduces the per thread
memory due to a reduced heap allocation overhead.
|