Commit Graph

26436 Commits

Author SHA1 Message Date
Sebastian Huber
a070c8bb81 rtems: Simplify rtems_semaphore_obtain() 2014-05-22 07:59:34 +02:00
Joel Sherrill
1bf0666448 schedulersmpimpl.h: Fix spacing 2014-05-21 15:08:23 -05:00
Sebastian Huber
82f9074308 score: _Thread_Set_life_protection()
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.
2014-05-21 11:48:25 +02:00
Sebastian Huber
c8e832886a score: Add and use _Scheduler_Get_index_by_id() 2014-05-21 11:48:25 +02:00
Sebastian Huber
4ddc3b53c6 score: Add const qualifier 2014-05-21 11:48:24 +02:00
Sebastian Huber
884a6c59ba score: Add comment regarding TLS workspace size 2014-05-21 09:41:01 +02:00
Sebastian Huber
40f2eafefd score: Simplify _Scheduler_Set() 2014-05-21 08:30:25 +02:00
Sebastian Huber
e5274df1d9 rtems: Clarify task set/get scheduler parameters 2014-05-20 10:03:35 +02:00
Sebastian Huber
2d96533299 score: SMP scheduler support documentation 2014-05-20 08:06:43 +02:00
Sebastian Huber
39840438bb dosfs: Fix read from invalid memory area 2014-05-16 15:34:33 +02:00
Sebastian Huber
1ac0b083f8 score: Simplify SMP scheduler support 2014-05-16 10:56:49 +02:00
Sebastian Huber
b532bb2c1e score: Fix state diagram 2014-05-16 10:56:49 +02:00
Sebastian Huber
c0bff5e936 score: Split SMP scheduler enqueue function
Extract code from _Scheduler_SMP_Enqueue_ordered() and move it to the
new function _Scheduler_SMP_Enqueue_scheduled_ordered() to avoid
untestable execution paths.

Add and use function _Scheduler_SMP_Unblock().
2014-05-15 12:18:49 +02:00
Sebastian Huber
b4bdbcfe27 score: Make _Thread_queue_Requeue() static
This function is only used by _Thread_Change_priority().  Make it static
to avoid the function call overhead in the performance critical function
_Thread_Change_priority().
2014-05-15 12:18:49 +02:00
Sebastian Huber
6359b68afe score: Add and use _Scheduler_SMP_Start_idle() 2014-05-15 12:18:49 +02:00
Sebastian Huber
3733b22410 score: Add and use _Scheduler_default_Schedule() 2014-05-15 12:18:48 +02:00
Sebastian Huber
f39f667a69 score: Simplify _Thread_Change_priority()
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.
2014-05-15 12:18:44 +02:00
Sebastian Huber
2369b10a71 score: Add and use _Scheduler_Get_context() 2014-05-14 17:01:22 +02:00
Sebastian Huber
0f41cc3f4b score: _Scheduler_priority_Ready_queue_requeue()
Delete unused function _Scheduler_priority_Ready_queue_requeue().
2014-05-14 16:49:27 +02:00
Sebastian Huber
c21c5912a8 score: Add STATES_RESTARTING
Use separate state for thread restart.
2014-05-14 16:49:27 +02:00
Sebastian Huber
01f302bd55 score: Typo 2014-05-14 16:49:27 +02:00
Sebastian Huber
0e8d55b0ca monitor: Support STATES_MIGRATING 2014-05-14 16:49:27 +02:00
Sebastian Huber
249eaf9991 bsps/sparc: Fix BSS initialization
Use __bss_start available via %g2 to clear the BSS section.  The usage
of _edata resulted in a copy of [_edata, __bss_start) from ROM to RAM
and then a clear to zero of this area.

Clear now only [__bss_start, _end).
2014-05-14 14:46:20 +02:00
Sebastian Huber
b2d191e833 bsps/sparc: Fix data copy in start procedure
Use the register %g4 for the data content since it must be an even
numbered register due to the std/ldd.  Use the register %g2 for the BSS
start address, so that it can be later re-used for the BSS zero loop.
2014-05-14 14:46:20 +02:00
Sebastian Huber
3730a07fac score: Use Scheduler_Context for SMP scheduler
Use the basic Scheduler_Context for the general SMP scheduler operations
to avoid usage of structure offsets to get the specialized context
variants.
2014-05-14 14:46:20 +02:00
Sebastian Huber
e9ee2f034d score: Capitalize SMP acronym 2014-05-14 14:46:20 +02:00
Sebastian Huber
c6522a6564 score: SMP scheduler documentation 2014-05-14 14:46:20 +02:00
Sebastian Huber
beab7329fc score: Introduce scheduler nodes
Rename scheduler per-thread information into scheduler nodes using
Scheduler_Node as the base type.  Use inheritance for specialized
schedulers.

Move the scheduler specific states from the thread control block into
the scheduler node structure.

Validate the SMP scheduler node state transitions in case RTEMS_DEBUG is
defined.
2014-05-14 14:46:19 +02:00
Sebastian Huber
5b1ff71ab7 score: Scheduler documentation 2014-05-14 14:46:19 +02:00
Daniel Cederman
774ee0029e sparc: Change asm to __asm__ to compile with -std=c99. 2014-05-14 10:33:28 +02:00
Ralf Kirchner
c8b7b32329 bsp/altera-caclone-v: Early printk support
Make sure printk can work early during BSP startup.
2014-05-12 15:57:50 +02:00
Sebastian Huber
390e73c4ee score: Move out of __RTEMS_HAVE_SYS_CPUSET_H__
Move _Scheduler_Get() and _Scheduler_Set() out of the #if
defined(__RTEMS_HAVE_SYS_CPUSET_H__) block.
2014-05-12 15:56:42 +02:00
Sebastian Huber
fa0a9a1893 bsps: Declare bsp_start_on_secondary_processors() 2014-05-12 09:32:20 +02:00
Sebastian Huber
6c5c2f39d0 bsps: Use bsp_start_on_secondary_processor()
Use a standard function for startup on secondary processors.
2014-05-12 09:23:51 +02:00
Sebastian Huber
64a04ac3c7 bsps: Use standard file name for BSP support 2014-05-12 09:01:40 +02:00
Sebastian Huber
ca2dd1ef09 bsp/leon3: Delete unused function 2014-05-12 08:37:05 +02:00
Sebastian Huber
6339cd2de2 rtems: Move extern "C" in <rtems.h>
Do not cover the includes with an extern "C".
2014-05-12 08:37:05 +02:00
Christian Mauderer
3a3869c449 bsps/sparc: Move flags to grlib header
This enables re-use for other BSPs
2014-05-12 08:37:00 +02:00
Sebastian Huber
89f079469c bsp/gen83xx: Disable interrupt nesting for br_uid
This is necessary for the USB support.
2014-05-08 13:02:44 +02:00
Sebastian Huber
11b05f11d4 score: Fix CPU context usage on SMP
We must not alter the is executing indicator in
_CPU_Context_Initialize() since this would cause an invalid state during
a self restart.

The is executing indicator must be valid at creation time since
otherwise _Thread_Kill_zombies() uses an undefined value for not started
threads.  This could result in a system life lock.
2014-05-08 13:02:40 +02:00
Sebastian Huber
35a3af7af8 doc: Use @dfn for glossary terms 2014-05-08 08:43:45 +02:00
Sebastian Huber
29e6637eb1 doc: Move SMP glossary to global glossary
Add some terms.
2014-05-08 08:43:45 +02:00
Sebastian Huber
d9196d1da7 configure: Paravirtualization for all targets
Virtual machines with paravirtualization exist not only on x86.
2014-05-08 08:40:35 +02:00
Sebastian Huber
23b9d09528 smptests/smp07: Fix test output 2014-05-07 18:32:15 +02:00
Sebastian Huber
8fa342218d smptests/smp05: Fix test name and output 2014-05-07 18:30:36 +02:00
Sebastian Huber
b97bc8bc71 tests: Add locked_printf_plugin()
Add locked_vprintf().  Return an int just like printf(), etc.
2014-05-07 18:27:19 +02:00
Sebastian Huber
0960fee406 rtems: Fix ASR SMP support
Initialize the ISR lock only once and destroy it properly.
2014-05-07 17:55:59 +02:00
Sebastian Huber
6c36946fea score: Fix SMP startup 2014-05-07 14:26:33 +02:00
Sebastian Huber
38b59a6d30 score: Implement forced thread migration
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.
2014-05-07 14:26:28 +02:00
Sebastian Huber
58444f7795 score: Delete _SMP_Test_message_default_handler
A default handler is not necessary.  The test message sender must ensure
that a handler is installed.
2014-05-07 12:08:11 +02:00