summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/smp.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* score: Add processor set to scheduler contextSebastian Huber2017-07-071-3/+2
| | | | | | | Replace the simple processor count with the processor set owned by the scheduler instance. Update #3059.
* score: Use <sys/bitset.h> for Processor_maskSebastian Huber2017-07-061-4/+4
| | | | | | | | Implement the Processor_mask via <sys/bitset.h>. Provide _Processor_mask_To_uint32_t() to enable its use in device specific routines, e.g. interrupt affinity register in an interrupt controller. Update #3059.
* SMP: Simplify SMP multicast actionsSebastian Huber2017-04-051-4/+3
|
* score: Rename _Scheduler_AssignmentsSebastian Huber2016-11-091-9/+35
| | | | | | | | Rename _Scheduler_Assignments into _Scheduler_Initial_assignments to make it clear that they may not reflect the run-time scheduler assignment. Update #2797.
* score: Add scheduler to per-CPU informationSebastian Huber2016-11-091-3/+7
| | | | | | | This makes it possible to adjust the scheduler of a processor at run-time. Update #2797.
* score: Add new SMP scheduler helping protocolSebastian Huber2016-11-021-0/+1
| | | | Update #2556.
* score: Postpone SMP shutdown in _Terminate()Sebastian Huber2016-07-061-2/+5
| | | | | This enables fatal extensions to continue program execution after some fatal errors.
* score: Fix SMP message handlingSebastian Huber2016-06-291-1/+1
| | | | | | | | According to the C11 standard only atomic read-modify-write operations guarantee that the last value written in modification order is read, see "7.17.3 Order and consistency". Thus we must use a read-modify-write in _SMP_Inter_processor_interrupt_handler() to make sure we read an up-to-date message.
* score: Remove the Giant lockSebastian Huber2016-05-201-9/+0
| | | | Update #2555.
* score: Replace watchdog handler implementationSebastian Huber2016-03-041-0/+1
| | | | | | | | | Use a red-black tree instead of delta chains. Close #2344. Update #2554. Update #2555. Close #2606.
* score: Distribute clock tick to all online CPUsSebastian Huber2016-03-041-1/+4
| | | | Update #2554.
* score: Add _SMP_Before_multitasking_action()Sebastian Huber2016-03-041-0/+23
| | | | | | | | | The use case for this is the Cortex-A9 MPCore which has per-processor registers (only accessible by a particular processor) for the global timer used by the clock driver. This might be useful for other drivers as well. Update #2554.
* score: Add _Per_CPU_Is_boot_processor()Sebastian Huber2016-03-041-0/+2
|
* score: Add _SMP_Online_processorsSebastian Huber2016-03-041-1/+4
|
* score: Rename Per_CPU_Control::startedSebastian Huber2016-03-041-2/+2
| | | | | Rename Per_CPU_Control::started into Per_CPU_Control::online to match standard nomenclature.
* score: Avoid SCORE_EXTERNSebastian Huber2016-02-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Delete SCORE_INIT. This finally removes the some.h: #ifndef SOME_XYZ_EXTERN #define SOME_XYZ_EXTERN extern #endif SOME_XYZ_EXTERN type xyz; some_xyz.c: #define SOME_XYZ_EXTERN #include <some.h> pattern in favour of some.h: extern type xyz; some_xyz.c #include <some.h> type xyz; Update #2559.
* score: Hide SMP lock profiling impl if disabledSebastian Huber2015-06-261-1/+2
| | | | The problem is that empty structures have a different size in C and C++.
* score: Move SMP CPU_USE_DEFERRED_FP_SWITCH checkSebastian Huber2015-06-251-0/+4
|
* smp: Add and use _SMP_Should_start_processor()Sebastian Huber2015-01-091-3/+9
|
* score: Rename SMP broadcast message functionDaniel Cederman2014-08-221-1/+1
| | | | Change message type to unsigned long to match other SMP message functions.
* score: Add function to send a SMP message to a set of CPUsDaniel Cederman2014-08-221-0/+16
|
* score: Fix race condition in SMP startupSebastian Huber2014-05-261-1/+8
| | | | | | | | | | | | | | Do not use the Per_CPU_Control::started in _SMP_Start_multitasking_on_secondary_processor() since this field may be not up to date when a secondary processor reads it. Use the read-only scheduler assignment instead. Add a new fatal error SMP_FATAL_MULTITASKING_START_ON_INVALID_PROCESSOR. This prevents out-of-bounds access. It is currently not possible to test these fatal errors. One option would be to fake values of the _CPU_SMP_Get_current_processor(), but unfortunately this function is inline on some architectures.
* score: Add and use _Scheduler_Get_context()Sebastian Huber2014-05-141-3/+4
|
* score: Fix SMP startupSebastian Huber2014-05-071-1/+3
|
* score: Implement forced thread migrationSebastian Huber2014-05-071-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* score: Delete _SMP_Test_message_default_handlerSebastian Huber2014-05-071-7/+1
| | | | | A default handler is not necessary. The test message sender must ensure that a handler is installed.
* score: Use atomic operations for SMP messagesSebastian Huber2014-05-051-5/+2
|
* score: Add SMP test message handlerSebastian Huber2014-05-051-0/+8
| | | | | This handler can be used to test the inter-processor interrupt implementation.
* score: SMP_FATAL_SCHEDULER_WITHOUT_PROCESSORSSebastian Huber2014-05-051-16/+0
| | | | | Avoid the SMP_FATAL_SCHEDULER_WITHOUT_PROCESSORS fatal error and make it a run-time error in rtems_scheduler_ident() and _Scheduler_Get_by_id().
* score: Use common names for per-CPU variablesSebastian Huber2014-04-221-23/+23
| | | | | | | | | | | | | | | | Use "cpu" for an arbitrary Per_CPU_Control variable. Use "cpu_self" for the Per_CPU_Control of the current processor. Use "cpu_index" for an arbitrary processor index. Use "cpu_index_self" for the processor index of the current processor. Use "cpu_count" for the processor count obtained via _SMP_Get_processor_count(). Use "cpu_max" for the processor maximum obtained by rtems_configuration_get_maximum_processors().
* score: Add clustered/partitioned schedulingSebastian Huber2014-04-151-13/+66
| | | | | | | | | | | | | | | 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.
* score: SMP initialization changesSebastian Huber2014-04-141-6/+27
| | | | | | | | | | | | | | | | | Add and use _CPU_SMP_Start_processor(). Add and use _CPU_SMP_Finalize_initialization(). This makes most _CPU_SMP_Initialize() functions a bit simpler since we can calculate the minimum value of the count of processors requested by the application configuration and the count of physically or virtually available processors in the high-level code. The CPU port has now the ability to signal a processor start failure. With the support for clustered/partitioned scheduling the presence of particular processors can be configured to be optional or mandatory. There will be a fatal error only in case mandatory processors are not present. The CPU port may use a timeout to monitor the start of a processor.
* Change all references of rtems.com to rtems.org.Chris Johns2014-03-211-1/+1
|
* score: Delete _Assert_Thread_dispatching_repressedSebastian Huber2014-03-191-1/+1
| | | | | | | | Add _Debug_Is_thread_dispatching_allowed(). This makes it possible to assert the opposite. Use _ISR_Disable_without_giant()/_ISR_Enable_without_giant() to avoid misleading secondary assertion failures.
* score: Add SMP lock profiling supportSebastian Huber2014-03-141-1/+1
|
* score: Add local context to SMP lock APISebastian Huber2014-03-111-4/+3
| | | | | | | | | | | 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.
* score: Add and use _Giant_Drop()Sebastian Huber2014-03-061-0/+8
| | | | New test smptests/smpfatal03.
* score: SMP initialization and shutdown changesSebastian Huber2014-03-061-54/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename _SMP_Request_other_cores_to_perform_first_context_switch() into _SMP_Request_start_multitasking() since this requests now a multitasking start on all configured and available processors. The name corresponds _Thread_Start_multitasking() and _SMP_Start_multitasking_on_secondary_processor() actions issued in response to this request. Move in source file to right place. Rename PER_CPU_STATE_READY_TO_BEGIN_MULTITASKING into PER_CPU_STATE_READY_TO_START_MULTITASKING. Rename PER_CPU_STATE_BEGIN_MULTITASKING into PER_CPU_STATE_REQUEST_START_MULTITASKING. Rename _SMP_Request_other_cores_to_shutdown() into _SMP_Request_shutdown(). Add a per-CPU state lock to protect all changes. This was necessary to offer a controlled shutdown of the system (atomic read/writes alone are not sufficient for this kind of synchronization). Add documentation for Per_CPU_State. Delete debug output. New tests smptests/smpfatal01 and smptests/smpfatal02.
* score: _SMP_Inter_processor_interrupt_handler()Sebastian Huber2014-02-191-41/+0
| | | | | Inline _SMP_Inter_processor_interrupt_handler() to avoid function call overhead. Remove debug output.
* score: Wait for per-CPU state changes laterSebastian Huber2014-02-191-9/+5
| | | | | | Wait for per-CPU changes into PER_CPU_STATE_READY_TO_BEGIN_MULTITASKING later. There is no need to delay the initialization of the main processor at this point.
* score: Initialize per-CPU locksSebastian Huber2014-02-191-0/+6
|
* score: Move _SMP_Handler_initialize()Sebastian Huber2014-02-191-0/+22
|
* score: Rename rtems_smp_process_interrupt()Sebastian Huber2014-02-191-2/+1
| | | | | | Rename rtems_smp_process_interrupt() into _SMP_Inter_processor_interrupt_handler(). Delete unused header file <rtems/bspsmp.h>.
* score: Rename rtems_smp_secondary_cpu_initialize()Sebastian Huber2014-02-191-1/+1
| | | | | | Rename rtems_smp_secondary_cpu_initialize() into _SMP_Start_multitasking_on_secondary_processor(). Move declaration to <rtems/score/smpimpl.h>.
* score: Add and use <rtems/score/smpimpl.h>Sebastian Huber2014-02-191-1/+1
| | | | | Collect SMP implementation specific parts in the <rtems/score/smpimpl.h> header file.
* score: Delete bsp_smp_broadcast_interrupt()Sebastian Huber2014-02-191-8/+4
| | | | | | Since the per-CPU SMP lock must be acquired and released to send the message a single interrupt broadcast operations offers no benefits. If synchronization is required, then a SMP barrier must be used anyway.
* score: Rename bsp_smp_initialize()Sebastian Huber2014-02-191-1/+1
| | | | | Rename bsp_smp_initialize() into _CPU_SMP_Initialize() since every CPU port must supply this function.
* score: Rename RTEMS_BSP_SMP_SHUTDOWNSebastian Huber2014-02-191-4/+4
| | | | | Rename RTEMS_BSP_SMP_SHUTDOWN in SMP_MESSAGE_SHUTDOWN since SMP messages have nothing to do with the BSP. Use UINT32_C() instead of casts.
* score: Add RTEMS_FATAL_SOURCE_SMPSebastian Huber2014-02-191-5/+2
| | | | | | Use rtems_fatal() instead of _CPU_Fatal_halt() to shutdown processors in SMP configurations since this allows intervention of BSP or application specific fatal extensions.
* score: Move _SMP_Request_other_cores_to_shutdown()Sebastian Huber2014-02-191-8/+14
| | | | | | Move _SMP_Request_other_cores_to_shutdown() invocation from rtems_shutdown_executive() to _Internal_error_Occurred() to allow a proper shutdown on SMP configurations even in the error case.