summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/percpu.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* score: Rename to _Scheduler_ControlSebastian Huber2017-09-271-1/+1
| | | | | | | Rename struct Scheduler_Control to _Scheduler_Control to allow its use in standard header files, e.g. <pthread.h>. Update #3112.
* score: Force Per_CPU_Control::executing alignmentSebastian Huber2016-11-231-0/+7
| | | | | | | | This fixes the CPU ports with relaxed alignment restrictions, e.g. type alignment is less than the type size. Close #2822. Close #2823.
* score: Group Per_CPU_Control members by alignmentSebastian Huber2016-11-211-19/+19
| | | | Close #2820.
* score: Add Per_CPU_Control::Interrupt_frameSebastian Huber2016-11-181-3/+25
| | | | Update #2809.
* score: Add Per_CPU_Control::isr_dispatch_disableSebastian Huber2016-11-181-1/+13
| | | | Update #2751.
* rtems: Add scheduler processor add/removeSebastian Huber2016-11-101-0/+6
| | | | Update #2797.
* score: Add scheduler to per-CPU informationSebastian Huber2016-11-091-4/+17
| | | | | | | This makes it possible to adjust the scheduler of a processor at run-time. Update #2797.
* score: Add optional _CPU_Get_thread_executing()Sebastian Huber2016-11-071-5/+13
|
* score: Prevent assignment to _Thread_ExecutingSebastian Huber2016-11-071-1/+1
|
* score: Add new SMP scheduler helping protocolSebastian Huber2016-11-021-0/+8
| | | | Update #2556.
* score: Fix C/C++ compatibility issueSebastian Huber2016-09-231-4/+6
| | | | | | | Only use CPU_Per_CPU_control if it contains at least one filed. In GNU C empty structures have a size of zero. In C++ structures have a non-zero size. In case CPU_PER_CPU_CONTROL_SIZE is defined to zero, then this structure is not used anymore.
* score: Fix SMP message handlingSebastian Huber2016-06-291-5/+0
| | | | | | | | 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-6/+0
| | | | Update #2555.
* score: Rename _ISR_Disable() and _ISR_Enable()Sebastian Huber2016-05-201-4/+4
| | | | | | | | | Rename _ISR_Disable() into _ISR_Local_disable(). Rename _ISR_Enable() into _ISR_Local_enable(). Remove _Debug_Is_owner_of_giant(). This is a preparation to remove the Giant lock. Update #2555.
* score: Rename _ISR_Disable_without_giant()Sebastian Huber2016-05-201-6/+6
| | | | | | | | | Rename _ISR_Disable_without_giant() into _ISR_Local_disable(). Rename _ISR_Enable_without_giant() into _ISR_Local_enable(). This is a preparation to remove the Giant lock. Update #2555.
* score: Add _ISR_lock_Is_owner()Sebastian Huber2016-05-121-0/+2
|
* score: Fix for RTEMS_DEBUGSebastian Huber2016-03-221-2/+2
| | | | | | | The rtems_extension_create() no longer uses the Giant lock. Ensure that we call _User_extensions_Add_set() only in the right context. Update #2555.
* score: Fix CPU time used by executing threadsSebastian Huber2016-03-171-4/+11
| | | | | | | | | | | | | | The CPU time used of a thread was previously maintained per-processor mostly during _Thread_Dispatch(). However, on SMP configurations the actual processor of a thread is difficult to figure out since thread dispatching is a highly asynchronous process (e.g. via inter-processor interrupts). Only the intended processor of a thread is known to the scheduler easily. Do the CPU usage accounting during thread heir updates in the context of the scheduler operations. Provide the function _Thread_Get_CPU_time_used() to get the CPU usage of a thread using proper locks to get a consistent value. Close #2627.
* score: Replace watchdog handler implementationSebastian Huber2016-03-041-2/+51
| | | | | | | | | Use a red-black tree instead of delta chains. Close #2344. Update #2554. Update #2555. Close #2606.
* score: Add _SMP_Before_multitasking_action()Sebastian Huber2016-03-041-0/+8
| | | | | | | | | 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/+19
|
* score: Rename Per_CPU_Control::startedSebastian Huber2016-03-041-3/+3
| | | | | Rename Per_CPU_Control::started into Per_CPU_Control::online to match standard nomenclature.
* Optional POSIX Cleanup initializationSebastian Huber2016-02-031-0/+7
| | | | Update #2408.
* SMP: Fix and optimize thread dispatchingSebastian Huber2015-09-281-9/+10
| | | | | | | | According to the C11 and C++11 memory models only a read-modify-write operation guarantees that we read the last value written in modification order. Avoid the sequential consistent thread fence and instead use the inter-processor interrupt to set the thread dispatch necessary indicator.
* score: Rename struct Thread_ControlSebastian Huber2015-07-301-5/+5
| | | | | Add a leading underscore to the structure name to allow forward declarations in standard header files provided by Newlib and GCC.
* score: Simplify _SMP_ticket_lock_Release()Sebastian Huber2015-07-011-1/+0
| | | | | Add a SMP lock statistics pointer to SMP_lock_Stats_context and drop the SMP lock statistics parameter from _SMP_ticket_lock_Release().
* score: Hide SMP lock profiling impl if disabledSebastian Huber2015-06-261-4/+13
| | | | The problem is that empty structures have a different size in C and C++.
* score: Simplify <rtems/score/thread.h>Sebastian Huber2015-06-251-6/+31
| | | | | | Avoid Thread_Control typedef in <rtems/score/percpu.h>. This helps to get rid of the <rtems/score/percpu.h> include in <rtems/score/thread.h> which exposes a lot of implementation details.
* score: Move SMP CPU_USE_DEFERRED_FP_SWITCH checkSebastian Huber2015-06-251-4/+0
|
* score: Add PER_CPU_OFFSET_EXECUTINGSebastian Huber2014-07-011-17/+21
| | | | | Add PER_CPU_OFFSET_HEIR. Move Per_CPU_Control::executing and Per_CPU_Control::heir for easy offset calculation.
* score: _Per_CPU_State_wait_for_non_initial_state()Sebastian Huber2014-06-051-24/+15
| | | | | Replace _Per_CPU_State_wait_for_ready_to_start_multitasking() with _Per_CPU_State_wait_for_non_initial_state(). Implement this function.
* score: Implement forced thread migrationSebastian Huber2014-05-071-5/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Use atomic operations for SMP messagesSebastian Huber2014-05-051-3/+4
|
* score: TypoSebastian Huber2014-04-301-1/+1
|
* score: Add _CPU_Get_current_per_CPU_control()Sebastian Huber2014-04-281-3/+7
| | | | | | | | | Add optional method _CPU_Get_current_per_CPU_control() to obtain the per-CPU control of the current processor. This is optional. Not every CPU port needs this. It is only an optional optimization variant. In case this macro is undefined, the default implementation using the current processor index will be used.
* score: Use common names for per-CPU variablesSebastian Huber2014-04-221-29/+29
| | | | | | | | | | | | | | | | 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-0/+19
| | | | | | | | | | | | | | | 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: Add _Per_CPU_Get_snapshot()Sebastian Huber2014-04-141-3/+12
|
* score: Add per-CPU state functionSebastian Huber2014-03-311-0/+39
| | | | | Add _Per_CPU_State_wait_for_ready_to_start_multitasking(). Add new fatal SMP error SMP_FATAL_SHUTDOWN_EARLY.
* Change all references of rtems.com to rtems.org.Chris Johns2014-03-211-1/+1
|
* score: Add SMP lock profiling supportSebastian Huber2014-03-141-3/+18
|
* score: Add per-CPU profilingSebastian Huber2014-03-141-0/+74
| | | | | | | Add per-CPU profiling stats API. Implement the thread dispatch disable level profiling. The interrupt profiling must be implemented in CPU port specific parts (mostly assembler code). Add a support function _Profiling_Outer_most_interrupt_entry_and_exit() for this purpose.
* score: Add local context to SMP lock APISebastian Huber2014-03-111-16/+62
| | | | | | | | | | | 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: Fix per-CPU state documentationSebastian Huber2014-03-061-3/+3
|
* score: SMP initialization and shutdown changesSebastian Huber2014-03-061-34/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Add and use <rtems/score/smpimpl.h>Sebastian Huber2014-02-191-7/+0
| | | | | Collect SMP implementation specific parts in the <rtems/score/smpimpl.h> header file.
* score: Per-CPU thread dispatch disable levelSebastian Huber2013-08-091-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a per-CPU thread dispatch disable level. So instead of one global thread dispatch disable level we have now one instance per processor. This is a major performance improvement for SMP. On non-SMP configurations this may simplifiy the interrupt entry/exit code. The giant lock is still present, but it is now decoupled from the thread dispatching in _Thread_Dispatch(), _Thread_Handler(), _Thread_Restart_self() and the interrupt entry/exit. Access to the giant lock is now available via _Giant_Acquire() and _Giant_Release(). The giant lock is still implicitly acquired via _Thread_Dispatch_decrement_disable_level(). The giant lock is only acquired for high-level operations in interrupt handlers (e.g. release of a semaphore, sending of an event). As a side-effect this change fixes the lost thread dispatch necessary indication bug in _Thread_Dispatch(). A per-CPU thread dispatch disable level greatly simplifies the SMP support for the interrupt entry/exit code since no spin locks have to be acquired in this area. It is only necessary to get the current processor index and use this to calculate the address of the own per-CPU control. This reduces the interrupt latency considerably. All elements for the interrupt entry/exit code are now part of the Per_CPU_Control structure: thread dispatch disable level, ISR nest level and thread dispatch necessary. Nothing else is required (except CPU port specific stuff like on SPARC).
* score: Add and use _Per_CPU_Acquire_all().Sebastian Huber2013-08-091-0/+30
| | | | | | | Add and use _Per_CPU_Release_all(). The context switch user extensions are invoked in _Thread_Dispatch(). This change is necessary to avoid the giant lock in _Thread_Dispatch().
* smp: Use ISR lock in per-CPU controlSebastian Huber2013-08-091-11/+19
| | | | | | | Rename _Per_CPU_Lock_acquire() to _Per_CPU_ISR_disable_and_acquire(). Rename _Per_CPU_Lock_release() to _Per_CPU_Release_and_ISR_enable(). Add _Per_CPU_Acquire() and _Per_CPU_Release().
* score/cpu: Add CPU_Per_CPU_controlSebastian Huber2013-08-091-2/+7
| | | | Add CPU port specific per-CPU control.