- Timestamp:
- 04/09/14 13:07:54 (10 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 509040f0
- Parents:
- 27270b0d
- git-author:
- Sebastian Huber <sebastian.huber@…> (04/09/14 13:07:54)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (04/15/14 08:41:44)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/user/conf.t
r27270b0d rc5831a3f 3502 3502 @subheading DESCRIPTION: 3503 3503 The Deterministic Priority Scheduler is the default scheduler in RTEMS 3504 for single coreapplications and is designed for predictable performance3504 for uni-processor applications and is designed for predictable performance 3505 3505 under the highest loads. It can block or unblock a thread in a constant 3506 3506 amount of time. This scheduler requires a variable amount of memory … … 3573 3573 @subheading DESCRIPTION: 3574 3574 The Earliest Deadline First Scheduler (EDF) is an alternative scheduler in 3575 RTEMS for single coreapplications. The EDF schedules tasks with dynamic3575 RTEMS for uni-processor applications. The EDF schedules tasks with dynamic 3576 3576 priorities equal to deadlines. The deadlines are declared using only 3577 3577 Rate Monotonic manager which handles periodic behavior. Period is always … … 3613 3613 @subheading DESCRIPTION: 3614 3614 The Constant Bandwidth Server Scheduler (CBS) is an alternative scheduler 3615 in RTEMS for single coreapplications. The CBS is a budget aware extension3615 in RTEMS for uni-processor applications. The CBS is a budget aware extension 3616 3616 of EDF scheduler. The goal of this scheduler is to ensure temporal 3617 3617 isolation of tasks. The CBS is equipped with a set of additional rules … … 3686 3686 @subheading DESCRIPTION: 3687 3687 The Simple SMP Priority Scheduler is derived from the Simple Priority 3688 Scheduler but is capable of scheduling threads across multiple cores.3688 Scheduler but is capable of scheduling threads across multiple processors. 3689 3689 It is designed to provide the same task scheduling behaviour as the 3690 3690 Deterministic Priority Scheduler while distributing threads across 3691 multiple cores. Being based upon the Simple Priority Scheduler, it also3691 multiple processors. Being based upon the Simple Priority Scheduler, it also 3692 3692 maintains a single sorted list of all ready threads. Thus blocking or 3693 3693 unblocking a thread is not a constant time operation with this scheduler. 3694 3694 3695 In addition, when allocating threads to cores, the algorithm is not3695 In addition, when allocating threads to processors, the algorithm is not 3696 3696 constant time. This algorithm was not designed with efficiency as a 3697 3697 primary design goal. Its primary design goal was to provide an SMP-aware … … 3793 3793 3794 3794 @c 3795 @c === Configuring Clustered/Partitioned Schedulers === 3796 @c 3797 @subsection Configuring Clustered/Partitioned Schedulers 3798 3799 Clustered/partitioned scheduling helps to control the worst-case latencies in 3800 the system. The goal is to reduce the amount of shared state in the system and 3801 thus prevention of lock contention. Modern multi-processor systems tend to 3802 have several layers of data and instruction caches. With clustered/partitioned 3803 scheduling it is possible to honour the cache topology of a system and thus 3804 avoid expensive cache synchronization traffic. 3805 3806 We have clustered scheduling in case the set of processors of a system is 3807 partitioned into non-empty pairwise-disjoint subsets. These subsets are called 3808 clusters. Clusters with a cardinality of one are partitions. Each cluster is 3809 owned by exactly one scheduler instance. In order to use clustered/partitioned 3810 scheduling the application designer has to answer two questions. 3811 3812 @enumerate 3813 @item How is the set of processors partitioned into clusters/partitions? 3814 @item Which scheduler is used for which cluster/partition? 3815 @end enumerate 3816 3817 @subheading CONFIGURATION: 3818 3819 The schedulers in an SMP system are statically configured on RTEMS. Firstly 3820 the application must select which scheduling algorithms are available with the 3821 following defines 3822 3823 @itemize @bullet 3824 @item @code{CONFIGURE_SCHEDULER_PRIORITY_SMP}, 3825 @item @code{CONFIGURE_SCHEDULER_SIMPLE_SMP}, and 3826 @item @code{CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP}. 3827 @end itemize 3828 3829 This is necessary to calculate the per-thread overhead introduced by the 3830 schedulers. After these definitions the configuration file must @code{#include 3831 <rtems/scheduler.h>} to have access to scheduler specific configuration macros. 3832 Each scheduler needs a context to store state information at run-time. To 3833 provide a context for each scheduler is the next step. Use the following 3834 macros to create scheduler contexts 3835 3836 @itemize @bullet 3837 @item @code{RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP(name, prio_count)}, 3838 @item @code{RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(name)}, and 3839 @item @code{RTEMS_SCHEDULER_CONTEXT_PRIORITY_AFFINITY_SMP(name, prio_count)}. 3840 @end itemize 3841 3842 The @code{name} parameter is used as part of a designator for a global 3843 variable, so the usual C/C++ designator rules apply. Additional parameters are 3844 scheduler specific. The schedulers are registered in the system via the 3845 scheduler table. To create the scheduler table define 3846 @code{CONFIGURE_SCHEDULER_CONTROLS} to a list of the following scheduler 3847 control initializers 3848 3849 @itemize @bullet 3850 @item @code{RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP(name, obj_name)}, 3851 @item @code{RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(name, obj_name)}, and 3852 @item @code{RTEMS_SCHEDULER_CONTROL_PRIORITY_AFFINITY_SMP(name, obj_name)}. 3853 @end itemize 3854 3855 The @code{name} parameter must correspond to the parameter defining the 3856 scheduler context. The @code{obj_name} determines the scheduler object name 3857 and can be used in @code{rtems_scheduler_ident()} to get the scheduler object 3858 identifier. 3859 3860 The last step is to define which processor uses which scheduler. 3861 For this purpose a scheduler assignment table must be defined. The entry count 3862 of this table must be equal to the configured maximum processors 3863 (@code{CONFIGURE_SMP_MAXIMUM_PROCESSORS}). A processor assignment to a 3864 scheduler can be optional or mandatory. The boot processor must have a 3865 scheduler assigned. In case the system needs more mandatory processors than 3866 available then a fatal run-time error will occur. To specify the scheduler 3867 assignments define @code{CONFIGURE_SMP_SCHEDULER_ASSIGNMENTS} to a list of 3868 @code{RTEMS_SCHEDULER_ASSIGN(index, attr)} and 3869 @code{RTEMS_SCHEDULER_ASSIGN_NO_SCHEDULER} macros. The @code{index} parameter 3870 must be a valid index into the scheduler table. The @code{attr} parameter 3871 defines the scheduler assignment attributes. By default a scheduler assignment 3872 to a processor is optional. For the scheduler assignment attribute use one of 3873 the mutually exclusive variants 3874 3875 @itemize @bullet 3876 @item @code{RTEMS_SCHEDULER_ASSIGN_DEFAULT}, 3877 @item @code{RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY}, and 3878 @item @code{RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL}. 3879 @end itemize 3880 3881 @subheading ERRORS: 3882 3883 In case one of the scheduler indices in 3884 @code{CONFIGURE_SMP_SCHEDULER_ASSIGNMENTS} is invalid a link-time error will 3885 occur with an undefined reference to @code{RTEMS_SCHEDULER_INVALID_INDEX}. 3886 3887 Some fatal errors may occur in case of scheduler configuration inconsistencies or a lack 3888 of processors on the system. The fatal source is 3889 @code{RTEMS_FATAL_SOURCE_SMP}. None of the errors is internal. 3890 3891 @itemize @bullet 3892 @item @code{SMP_FATAL_BOOT_PROCESSOR_NOT_ASSIGNED_TO_SCHEDULER} - the boot 3893 processor must have a scheduler assigned. 3894 @item @code{SMP_FATAL_MANDATORY_PROCESSOR_NOT_PRESENT} - there exists a 3895 mandatory processor beyond the range of physically or virtually available 3896 processors. The processor demand must be reduced for this system. 3897 @item @code{SMP_FATAL_START_OF_MANDATORY_PROCESSOR_FAILED} - the start of a 3898 mandatory processor failed during system initialization. The system may not 3899 have this processor at all or it could be a problem with a boot loader for 3900 example. 3901 the @code{CONFIGURE_SMP_SCHEDULER_ASSIGNMENTS} definition. 3902 @item @code{SMP_FATAL_SCHEDULER_WITHOUT_PROCESSORS} - it is prohibited to have 3903 a scheduler managing the empty processor set. 3904 @item @code{SMP_FATAL_MULTITASKING_START_ON_UNASSIGNED_PROCESSOR} - it is not 3905 allowed to start multitasking on a processor with no scheduler assigned. 3906 @end itemize 3907 3908 @subheading EXAMPLE: 3909 3910 The following example shows a scheduler configuration for a hypothetical 3911 product using two chip variants. One variant has four processors which is used 3912 for the normal product line and another provides eight processors for the 3913 high-performance product line. The first processor performs hard-real time 3914 control of actuators and sensors. The second processor is not used by RTEMS at 3915 all and runs a Linux instance to provide a graphical user interface. The 3916 additional processors are used for a worker thread pool to perform data 3917 processing operations. 3918 3919 The processors managed by RTEMS use two Deterministic Priority scheduler 3920 instances capable of dealing with 256 priority levels. The scheduler with 3921 index zero has the name @code{"IO "}. The scheduler with index one has the 3922 name @code{"WORK"}. The scheduler assignments of the first, third and fourth 3923 processor are mandatory, so the system must have at least four processors, 3924 otherwise a fatal run-time error will occur during system startup. The 3925 processor assignments for the fifth up to the eighth processor are optional so 3926 that the same application can be used for the normal and high-performance 3927 product lines. The second processor has no scheduler assigned and runs Linux. 3928 A hypervisor will ensure that the two systems cannot interfere in an 3929 undesirable way. 3930 3931 @example 3932 @group 3933 #define CONFIGURE_SMP_MAXIMUM_PROCESSORS 8 3934 3935 #define CONFIGURE_MAXIMUM_PRIORITY 255 3936 3937 /* Make the scheduler algorithm available */ 3938 3939 #define CONFIGURE_SCHEDULER_PRIORITY_SMP 3940 3941 #include <rtems/scheduler.h> 3942 3943 /* Create contexts for the two scheduler instances */ 3944 3945 RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP(io, CONFIGURE_MAXIMUM_PRIORITY + 1); 3946 3947 RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP(work, CONFIGURE_MAXIMUM_PRIORITY + 1); 3948 3949 /* Define the scheduler table */ 3950 3951 #define CONFIGURE_SCHEDULER_CONTROLS \ 3952 RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP( \ 3953 io, \ 3954 rtems_build_name('I', 'O', ' ', ' ') \ 3955 ), \ 3956 RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP( \ 3957 work, \ 3958 rtems_build_name('W', 'O', 'R', 'K') \ 3959 ) 3960 3961 /* Define the processor to scheduler assignments */ 3962 3963 #define CONFIGURE_SMP_SCHEDULER_ASSIGNMENTS \ 3964 RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY), \ 3965 RTEMS_SCHEDULER_ASSIGN_NO_SCHEDULER, \ 3966 RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY), \ 3967 RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY), \ 3968 RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \ 3969 RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \ 3970 RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \ 3971 RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL) 3972 @end group 3973 @end example 3974 3975 @c 3795 3976 @c === SMP Specific Configuration Parameters === 3796 3977 @c … … 3805 3986 @c === CONFIGURE_SMP_APPLICATION === 3806 3987 @c 3807 @subsection Specify Application Uses Multiple Cores (is SMP)3988 @subsection Enable SMP Support for Applications 3808 3989 3809 3990 @findex CONFIGURE_SMP_APPLICATION … … 3820 4001 3821 4002 @item DEFAULT VALUE: 4003 This is not defined by default. 4004 4005 @end table 4006 4007 @subheading DESCRIPTION: 4008 @code{CONFIGURE_SMP_APPLICATION} must be defined to enable SMP support for the 4009 application. 4010 4011 @subheading NOTES: 4012 This define may go away in the future in case all RTEMS components are SMP ready. 4013 4014 @c 4015 @c === CONFIGURE_SMP_MAXIMUM_PROCESSORS === 4016 @c 4017 @subsection Specify Maximum Processors in SMP System 4018 4019 @findex CONFIGURE_SMP_MAXIMUM_PROCESSORS 4020 4021 @table @b 4022 @item CONSTANT: 4023 @code{CONFIGURE_SMP_MAXIMUM_PROCESSORS} 4024 4025 @item DATA TYPE: 4026 Unsigned integer (@code{uint32_t}). 4027 4028 @item RANGE: 4029 Defined or undefined. 4030 4031 @item DEFAULT VALUE: 3822 4032 The default value is 1, (if CONFIGURE_SMP_APPLICATION is defined). 3823 4033 … … 3825 4035 3826 4036 @subheading DESCRIPTION: 3827 @code{CONFIGURE_SMP_APPLICATION} must be defined if the application is3828 to make use of multiple CPU cores in an SMP target system.3829 3830 @subheading NOTES:3831 None.3832 3833 @c3834 @c === CONFIGURE_SMP_MAXIMUM_PROCESSORS ===3835 @c3836 @subsection Specify Maximum Processors in SMP System3837 3838 @findex CONFIGURE_SMP_MAXIMUM_PROCESSORS3839 3840 @table @b3841 @item CONSTANT:3842 @code{CONFIGURE_SMP_MAXIMUM_PROCESSORS}3843 3844 @item DATA TYPE:3845 Unsigned integer (@code{uint32_t}).3846 3847 @item RANGE:3848 Defined or undefined.3849 3850 @item DEFAULT VALUE:3851 The default value is 1, (if CONFIGURE_SMP_APPLICATION is defined).3852 3853 @end table3854 3855 @subheading DESCRIPTION:3856 4037 @code{CONFIGURE_SMP_MAXIMUM_PROCESSORS} must be set to the number of 3857 CPU cores in the SMP configuration.3858 3859 @subheading NOTES: 3860 If there are more cores available than configured, the rest will be4038 processors in the SMP configuration. 4039 4040 @subheading NOTES: 4041 If there are more processors available than configured, the rest will be 3861 4042 ignored. 3862 4043
Note: See TracChangeset
for help on using the changeset viewer.