Commit Graph

3134 Commits

Author SHA1 Message Date
Joel Sherrill
a44fa5a7ce utf8proc01: Honor BSP_SMALL_MEMORY 2014-04-22 08:37:02 -05:00
Joel Sherrill
faa4e4c08d flashdisk01: Honor BSP_SMALL_MEMORY 2014-04-22 08:37:02 -05:00
Joel Sherrill
2bea49479a fsdosfsname01: Honor BSP_SMALL_MEMORY 2014-04-22 08:37:02 -05:00
Joel Sherrill
97ae79d762 fsdosfsformat01: Honor BSP_SMALL_MEMORY 2014-04-22 08:37:02 -05:00
Sebastian Huber
b3613c3a37 smptests/smpload01: Reduce timeout value
Use events instead of suspend/resume.
2014-04-16 12:34:07 +02:00
Sebastian Huber
c5831a3f9a score: Add clustered/partitioned scheduling
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.
2014-04-15 10:41:44 +02:00
Sebastian Huber
27270b0d6c rtems: Add task get/set scheduler 2014-04-15 09:29:35 +02:00
Sebastian Huber
1b67535d86 rtems: Add scheduler get processors 2014-04-15 09:29:35 +02:00
Sebastian Huber
b427a92adf rtems: Add scheduler identification 2014-04-15 09:29:31 +02:00
Sebastian Huber
0712d172d0 score: Task get/set affinity
Make rtems_task_get_affinity() and rtems_task_set_affinity() available
on non-SMP configurations.  Allow larger CPU sets.
2014-04-15 08:37:12 +02:00
Sebastian Huber
e1598a616d score: Static scheduler configuration
Do not allocate the scheduler control structures from the workspace.
This is a preparation step for configuration of clustered/partitioned
schedulers on SMP.
2014-04-15 08:37:11 +02:00
Joel Sherrill
589bbcb0ed sp74.doc: Correct minor typos 2014-04-14 16:05:52 -05:00
Sebastian Huber
cb5eaddf95 rtems: Rename rtems_smp_get_current_processor()
Rename rtems_smp_get_current_processor() in
rtems_get_current_processor().  Make rtems_get_current_processor() a
function in uni-processor configurations to enable ABI compatibility
with SMP configurations.
2014-04-11 08:52:54 +02:00
Sebastian Huber
4bc8d2e717 rtems: Rename rtems_smp_get_processor_count()
Rename rtems_smp_get_processor_count() in rtems_get_processor_count().
Make rtems_get_processor_count() a function in uni-processor
configurations to enable ABI compatibility with SMP configurations.
2014-04-11 08:52:54 +02:00
Sebastian Huber
263f4becea score: Statically initialize IO manager
This simplifies the RTEMS initialization and helps to avoid a memory
overhead.  The workspace demands of the IO manager were not included in
the <rtems/confdefs.h> workspace size estimate.  This is also fixed as a
side-effect.

Update documentation and move "Specifying Application Defined Device
Driver Table" to the section end.  This sub-section is not that
important for the user.  Mentioning this at the beginning may lead to
confusion.
2014-04-10 12:37:40 +02:00
Sebastian Huber
2d5424d2d0 sptests/sp37: Account for internal struct align 2014-04-09 15:30:24 +02:00
Sebastian Huber
c3cd7e7b7b smptests/smpschedule01: Rename in smpscheduler01 2014-04-09 15:27:21 +02:00
Sebastian Huber
eeb45b5cb9 sptests/sp68: Fix configuration 2014-04-07 16:48:02 +02:00
Sebastian Huber
fef4293834 psxtests/psxkey02: Test for proper error case 2014-04-07 16:48:02 +02:00
Sebastian Huber
316ba974ba tmtests/tm21: Fix configuration 2014-04-07 16:48:01 +02:00
Sebastian Huber
781631ebe4 sptests/spwatchdog: Fix for short enums 2014-04-07 14:51:31 +02:00
Sebastian Huber
e785fbaae5 score: Delete _Thread_Ticks_per_timeslice
Use the Configuration instead.
2014-04-07 14:51:31 +02:00
Sebastian Huber
4744584698 score: Delete _Thread_Maximum_extensions
Use the Configuration instead.
2014-04-07 14:51:31 +02:00
Joel Sherrill
d507c03731 Disable per task variables when SMP is enabled
Per task variables are inherently unsafe in SMP systems. This
patch disables them from the build and adds warnings in the
appropriate documentation and configuration sections.
2014-04-04 14:27:27 -05:00
Sebastian Huber
cae120e23c rhealstone/rhmlatency: Fix configuration 2014-04-04 17:06:52 +02:00
Sebastian Huber
24934e36e2 score: Add scheduler control to scheduler ops
Scheduler operations must be free of a global scheduler context to
enable partitioned/clustered scheduling.
2014-04-04 11:01:18 +02:00
Jennifer Averett
af53e6cffa smpaffinity01: Use Priority Affinity SMP scheduler. 2014-04-03 10:48:58 -05:00
Jennifer Averett
d4e1ead87d smppsxaffinity01: Use Priority Affinity SMP scheduler. 2014-04-03 10:48:57 -05:00
Jennifer Averett
cb283959ce smppsxaffinity02: Use Priority Affinity SMP scheduler. 2014-04-03 10:48:57 -05:00
Sebastian Huber
1a6093dc60 samples/fileio: Fix configuration 2014-04-03 12:53:24 +02:00
Sebastian Huber
494c2e3002 score: Move priority bit map to scheduler instance
Delete global variables _Priority_Major_bit_map and _Priority_Bit_map.
This makes it possible to use multiple priority scheduler instances for
example with clustered/partitioned scheduling on SMP.
2014-04-03 11:13:26 +02:00
Sebastian Huber
3f5f2ce229 score: PR788: Add INTERNAL_ERROR_RESOURCE_IN_USE
Issue a fatal error in case a thread is deleted which still owns
resources (e.g. a binary semaphore with priority inheritance or ceiling
protocol).  The resource count must be checked quite late since RTEMS
task variable destructors, POSIX key destructors, POSIX cleanup handler,
the Newlib thread termination extension or other thread termination
extensions may release resources.  In this context it would be quite
difficult to return an error status to the caller.

An alternative would be to place threads with a non-zero resource count
not on the zombie chain.  Thus we have a resource leak instead of a
fatal error.  The terminator thread can see this error if we return an
RTEMS_RESOURCE_IN_USE status for the rtems_task_delete() for example.
2014-04-03 11:13:25 +02:00
Sebastian Huber
3ccfd98bc1 libtests/newlib01: New test 2014-04-01 14:10:22 +02:00
Sebastian Huber
57db5f13fb smptests/smpthreadlife01: Avoid bad profiling stat 2014-04-01 14:10:22 +02:00
Sebastian Huber
91e7b0c5ae score: PR2172: _Thread_queue_Extract()
Add _Thread_queue_Extract_with_return_code().  On SMP this sequence in
_Thread_queue_Process_timeout() was broken:

[...]
      /*
       * After we enable interrupts here, a lot may happen in the
       * meantime, e.g. nested interrupts may release the resource that
       * times out here.  So we enter _Thread_queue_Extract()
       * speculatively.  Inside this function we check the actual status
       * under ISR disable protection.  This ensures that exactly one
       * executing context performs the extract operation (other parties
       * may call _Thread_queue_Dequeue()).  If this context won, then
       * we have a timeout.
       *
       * We can use the_thread_queue pointer here even if
       * the_thread->Wait.queue is already set to NULL since the extract
       * operation will only use the thread queue discipline to select
       * the right extract operation.  The timeout status is set during
       * thread queue initialization.
       */
      we_did_it = _Thread_queue_Extract( the_thread_queue, the_thread );
      if ( we_did_it ) {
        the_thread->Wait.return_code = the_thread_queue->timeout_status;
      }
[...]

In case _Thread_queue_Extract() successfully extracted a thread, then
this thread may start execution on a remote processor immediately and
read the the_thread->Wait.return_code before we update it here with the
timeout status.  Thus it observes a successful operation even if it
timed out.
2014-04-01 14:10:22 +02:00
Sebastian Huber
b9b014ea7e smptests/smpthreadlife01: Typo 2014-03-31 15:49:35 +02:00
Sebastian Huber
a881ff299e smptests/smpthreadlife01: Add test cases 2014-03-31 15:46:03 +02:00
Sebastian Huber
ab816bcb01 sptests/sptask_err04: Fix broken test 2014-03-31 10:14:43 +02:00
Sebastian Huber
03e8928753 score: Delete CORE_mutex_Control::lock
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.
2014-03-31 10:14:42 +02:00
Sebastian Huber
f0b4fd9c2e score: Do not reset resource count during restart
This fixes an integer underflow problem in case resources are released
after a thread restart.

Add new test sptests/spthreadlife01.
2014-03-31 10:14:35 +02:00
Sebastian Huber
23fec9f0e1 score: PR2152: Use allocator mutex for objects
Use allocator mutex for objects allocate/free.  This prevents that the
thread dispatch latency depends on the workspace/heap fragmentation.
2014-03-31 08:29:44 +02:00
Sebastian Huber
1b1be254e7 score: 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.
2014-03-31 08:29:43 +02:00
Sebastian Huber
391ad3ee4f score: Fix thread restart extensions context
Run the thread restart extensions in the context of the restarted
thread.  Run them with thread dispatching enabled.
2014-03-31 08:29:43 +02:00
Sebastian Huber
5c731a8348 score: Use thread action for thread restart
The thread restart is now supported on SMP.  New test
smptests/smpthreadlife01.
2014-03-31 08:29:43 +02:00
Sebastian Huber
ecd8c8add2 tests/fatal: Fix test names 2014-03-31 08:29:42 +02:00
Sebastian Huber
d98217ccd1 psxtests/psxconfig01: Fix for POSIX keys config 2014-03-31 08:29:42 +02:00
Sebastian Huber
2c83ac3658 smptests/smpfatal03: Fix end of test output 2014-03-31 08:29:42 +02:00
Sebastian Huber
5a13ef9d71 sptests/sp44: Fix end of test output 2014-03-31 08:29:42 +02:00
Bjorn Larsson
df367faddb sptests: New tests split from sp09 screen 1 and screen 2.
Split sp09 screen 1 into new test sptask_err04.
Split sp09 screen 2 into new tests sptask__err02 and spclock_err01,
as well as moving one verification into sptimer_err01.
2014-03-28 13:09:06 -05:00
Bjorn Larsson
719c7e55e4 sptask_err03: New test split from sp09 screen 3. 2014-03-28 13:09:06 -05:00