| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Drop scheduler parameter. Coding style.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The function to change a thread priority was too complex. Simplify it
with a new scheduler operation. This increases the average case
performance due to the simplified logic. The interrupt disabled
critical section is a bit prolonged since now the extract, update and
enqueue steps are executed atomically. This should however not impact
the worst-case interrupt latency since at least for the Deterministic
Priority Scheduler this sequence can be carried out with a wee bit of
instructions and no loops.
Add _Scheduler_Change_priority() to replace the sequence of
- _Thread_Set_transient(),
- _Scheduler_Extract(),
- _Scheduler_Enqueue(), and
- _Scheduler_Enqueue_first().
Delete STATES_TRANSIENT, _States_Is_transient() and
_Thread_Set_transient() since this state is now superfluous.
With this change it is possible to get rid of the
SCHEDULER_SMP_NODE_IN_THE_AIR state. This considerably simplifies the
implementation of the new SMP locking protocols.
|
|
|
|
|
| |
Always initialize the freechain. This prevents a NULL pointer access in
case no initial key value pairs are defined.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Clustered/partitioned scheduling helps to control the worst-case
latencies in the system. The goal is to reduce the amount of shared
state in the system and thus prevention of lock contention. Modern
multi-processor systems tend to have several layers of data and
instruction caches. With clustered/partitioned scheduling it is
possible to honour the cache topology of a system and thus avoid
expensive cache synchronization traffic.
We have clustered scheduling in case the set of processors of a system
is partitioned into non-empty pairwise-disjoint subsets. These subsets
are called clusters. Clusters with a cardinality of one are partitions.
Each cluster is owned by exactly one scheduler instance.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Use the Configuration instead.
|
|
|
|
|
| |
Scheduler operations must be free of a global scheduler context to
enable partitioned/clustered scheduling.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
The holder field is enough to determine if a mutex is locked or not.
This leads also to better error status codes in case a
rtems_semaphore_release() is done for a mutex without having the
ownership.
|
|
|
|
|
| |
Use allocator mutex for objects allocate/free. This prevents that the
thread dispatch latency depends on the workspace/heap fragmentation.
|
|
|
|
|
| |
It is no longer necessary to protect the workspace allocations with the
Giant lock due to the thread life cycle re-implementation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The thread deletion is now supported on SMP.
This change fixes the following PRs:
PR1814: SMP race condition between stack free and dispatch
PR2035: psxcancel reveals NULL pointer access in _Thread_queue_Extract()
The POSIX cleanup handler are now called in the right context (should be
called in the context of the terminating thread).
http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_09.html
Add a user extension the reflects a thread termination event. This is
used to reclaim the Newlib reentrancy structure (may use file
operations), the POSIX cleanup handlers and the POSIX key destructors.
|
|
|
|
|
| |
Run the thread restart extensions in the context of the restarted
thread. Run them with thread dispatching enabled.
|
| |
|
|
|
|
|
|
|
|
| |
The man-page for pthread_setspecific does not define the EAGAIN return value.
Further without this patch it was not possible to set keys that have been
already set a new value.
Add test for setting a new value to a already set key.
|
| |
|
| |
|
|
|
|
|
|
| |
Enable pthread_once() for all configurations. The pthread_once()
function is one means to initialize POSIX keys. Another use case is the
C++ support.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This partially reverts commit 1215fd4d9426a59d568560e9a485628560363133.
In order to support profiling of SMP locks and provide a future
compatible SMP locks API it is necessary to add an SMP lock destroy
function. Since the commit above adds an SMP lock to each chain control
we would have to add a rtems_chain_destroy() function as well. This
complicates the chain usage dramatically. Thus revert the patch above.
A global SMP lock for all chains is used to implement the protected
chain operations.
Advantages:
* The SAPI chain API is now identical on SMP and non-SMP
configurations.
* The size of the chain control is reduced and is then equal to the
Score chains.
* The protected chain operations work correctly on SMP.
Disadvantage:
* Applications using many different chains and the protected operations
may notice lock contention.
The chain control size drop is a huge benefit (SAPI chain controls are
66% larger than the Score chain controls). The only disadvantage is not
really a problem since these applications can use specific interrupt
locks and unprotected chain operations to avoid this issue.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Formerly POSIX keys were only enabled when POSIX threads
were enabled. Because they are a truly safe alternative
to per-task variables in an SMP system, they are being
enabled in all configurations.
|
| |
|
|
|
|
|
| |
This is a useful POSIX thread API helper which is found in
`GNU/Linux and *BSD.
|
|
|
|
|
|
|
| |
This patch adds the following methods:
+ pthread_get_affinity_np
+ pthread_set_affinity_np
|
|
|
|
|
|
|
| |
This patch adds the following methods:
+ pthread_attr_get_affinity_np
+ pthread_attr_set_affinity_np
|
| |
|
|
|
|
|
| |
With the addition of pthread affinity information in pthread_attr_t,
the existing code for pthread_attr_t had to be adjusted.
|
| |
|
| |
|
|
|
|
|
|
| |
Reproducable crashes occur when using pthreads and the capture engine
at the same time. 'pthread_create()' is the culprit. It creates a SCORE thread
and then calls Thread_Start( ) without disabling thread-dispatching.
|
| |
|
|
|
|
|
| |
This is highly unlikely and would indicate a serious bug
in the system or corruption. But it is better to be cautious.
|
| |
|
|
|
|
|
|
| |
This error check was commented out because it is not in the POSIX
specification. However, the GNU/Linux manual page does document
that EPERM is to be returned in this situation.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|