Rev 1063 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1063 | tullio | 1 | |
2 | /* |
||
3 | * This program is free software; you can redistribute it and/or modify |
||
4 | * it under the terms of the GNU General Public License as published by |
||
5 | * the Free Software Foundation; either version 2 of the License, or |
||
6 | * (at your option) any later version. |
||
7 | * |
||
8 | * This program is distributed in the hope that it will be useful, |
||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
11 | * GNU General Public License for more details. |
||
12 | * |
||
13 | * You should have received a copy of the GNU General Public License |
||
14 | * along with this program; if not, write to the Free Software |
||
15 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
16 | * |
||
17 | */ |
||
18 | |||
881 | trimarchi | 19 | //fsf_configuration_parameters.h |
20 | //=============================================================== |
||
21 | // FFFFFFIII RRRRR SSTTTTTTT |
||
22 | // FF IIR RR SS |
||
23 | // FF IR SS |
||
24 | // FFFFFF RRRR SSSSST |
||
25 | // FF FI RRR SS |
||
26 | // FF II RRR SS |
||
27 | // FF IIIIIR RS |
||
28 | // |
||
29 | // Basic FSF(FIRST Scheduling Framework) configuration parameters |
||
30 | //============================================================== |
||
31 | |||
32 | ////////////////////////////////////////////////////// |
||
33 | // Definitions required to configure the fsf |
||
34 | // scheduling algorithms. |
||
35 | |||
889 | trimarchi | 36 | #include <unistd.h> |
37 | #include "stdbool.h" |
||
881 | trimarchi | 38 | |
39 | #ifndef _FSF_CONFIGURATION_PARAMETERS_H_ |
||
40 | #define _FSF_CONFIGURATION_PARAMETERS_H_ |
||
41 | |||
42 | // This symbol specifies whether the scheduler will make a |
||
43 | // schedulability test of the requested contract or not |
||
44 | |||
45 | #define FSF_ADMISSION_TEST_IS_ENABLED true |
||
46 | |||
47 | |||
48 | // Tune these values for optimizing the amount of memory used by the |
||
49 | // implementation |
||
50 | |||
51 | // Maximum number of accepted contracts (servers) |
||
52 | |||
972 | trimarchi | 53 | #define FSF_MAX_N_SERVERS 125 |
881 | trimarchi | 54 | |
55 | |||
56 | // Maximum number of threads that may be scheduled by the framework |
||
57 | |||
972 | trimarchi | 58 | #define FSF_MAX_N_THREADS 25 |
881 | trimarchi | 59 | |
60 | |||
61 | // Maximum number of critical sections that can be stored in a |
||
62 | // contract parameters object |
||
63 | |||
985 | julio | 64 | #define FSF_MAX_N_CRITICAL_SECTIONS 25 |
881 | trimarchi | 65 | |
66 | |||
67 | // Maximum number of utilization values (pairs of budget and period) |
||
68 | // that can be stored in a contract parameters object |
||
69 | |||
70 | #define FSF_MAX_N_UTILIZATION_VALUES 5 |
||
71 | |||
72 | |||
73 | // Maximum number of synchronization objects |
||
74 | |||
75 | #define FSF_MAX_N_SYNCH_OBJECTS 5 |
||
76 | |||
77 | |||
78 | // Maximum number of shared objects |
||
79 | |||
80 | #define FSF_MAX_N_SHARED_OBJECTS 100 |
||
81 | |||
82 | |||
83 | //////////////////////////////////////////// |
||
84 | // Other implementation dependent parameters |
||
85 | |||
86 | // The current implementation in MaRTE OS uses the Application-Defined |
||
87 | // Scheduling Interface (proposed to the POSIX standardization |
||
88 | // committee), to create a fixed-priority-based scheduler that |
||
89 | // operates under the rules of the FIRST scheduling framework. |
||
90 | |||
91 | // In this implementation there are two special threads: |
||
92 | // - The application scheduler thread, that |
||
93 | // implements the scheduler |
||
94 | |||
95 | // - The service thread, that is in charge of |
||
96 | // negotiating and renegotiating contracts |
||
97 | // concurrently with the application |
||
98 | |||
99 | // The following symbols are necessary to adapt the application to the |
||
100 | // underlying fixed priority scheduler |
||
101 | |||
102 | // Priority assigned to the application scheduler; it should be above |
||
103 | // the priorities of the application threads and of the service |
||
104 | // thread, and it should be at least 1 level below the maximum of the |
||
105 | // system |
||
106 | |||
985 | julio | 107 | #define FSF_SCHEDULER_PRIORITY 29 |
881 | trimarchi | 108 | |
109 | |||
110 | // Real-time signal number reserved for the application scheduler to |
||
111 | // manage its timers. |
||
112 | |||
113 | #define FSF_SCHEDULER_SIGNAL SIGRTMIN |
||
114 | |||
115 | |||
116 | // The highest priority that can be assigned to an application thread, |
||
117 | // it should be defined as one level less than the |
||
118 | // FSF_SCHEDULER_PRIORITY |
||
119 | |||
120 | #define FSF_HIGHEST_THREAD_PRIORITY FSF_SCHEDULER_PRIORITY-1 |
||
121 | |||
122 | |||
123 | // The lowest priority that can be assigned to an application thread, |
||
124 | // it should be at least 1 level above the minimum of the system |
||
125 | |||
972 | trimarchi | 126 | #define FSF_LOWEST_THREAD_PRIORITY 3 |
881 | trimarchi | 127 | |
128 | // Each call to the functions that negotiate or renegotiate a contract |
||
129 | // or that change the quality and importance generates a request for |
||
130 | // the service thread that we call a service job. This job will be |
||
131 | // pending in a queue until executed by the service thread. The |
||
132 | // following symbol represents the maximum number of requests that can |
||
133 | // be simultaneously queued. |
||
134 | #define FSF_MAX_N_SERVICE_JOBS FSF_MAX_N_SERVERS * 2 |
||
135 | |||
136 | // In order to bound the background activity of the scheduler (i.e., |
||
137 | // the admission tests necessary for the negotiation and |
||
138 | // re-negotiation of contracts), a service thread has been defined. It |
||
139 | // runs at a given priority level and has a budget and period |
||
140 | // assigned. |
||
141 | |||
142 | |||
143 | // Initial period of the service thread (timespec) |
||
144 | |||
985 | julio | 145 | #define FSF_SERVICE_THREAD_PERIOD {0,10000000} //0.01 seg //3.1 0.01 |
881 | trimarchi | 146 | |
147 | |||
148 | // Initial budget of the service thread (timespec) |
||
149 | |||
985 | julio | 150 | #define FSF_SERVICE_THREAD_BUDGET {0,1000000} //0.001 seg //3.1 0.001 |
881 | trimarchi | 151 | |
152 | |||
153 | // Initial priority of the service thread, it has to be lower than the |
||
154 | // FSF_SCHEDULER_PRIORITY, and is set according to its period and the |
||
155 | // expected response times for reconfiguration or tunning of the |
||
156 | // system. |
||
157 | |||
972 | trimarchi | 158 | #define FSF_SERVICE_THREAD_PRIORITY FSF_LOWEST_THREAD_PRIORITY+1 //3 3 //3 1 |
881 | trimarchi | 159 | |
160 | |||
161 | |||
162 | //Maximum number of servers that can be simultaneusly waiting for |
||
163 | //being signaled in a synchronization object |
||
164 | |||
165 | #define FSF_MAX_N_SERVERS_IN_SYNCH_OBJECT 4 |
||
166 | |||
167 | |||
168 | //Maximum number of events that can be pending to be signaled in a |
||
169 | //synchronization object |
||
170 | |||
171 | #define FSF_MAX_N_EVENTS_IN_SYNCH_OBJECT 100 |
||
172 | |||
173 | |||
174 | //Maximum number of pending replenishments in each sporadic server |
||
175 | |||
985 | julio | 176 | #define FSF_MAX_N_PENDING_REPLENISHMENTS 250 |
881 | trimarchi | 177 | |
178 | |||
972 | trimarchi | 179 | //Maximum number of target windows in a table driven schedule |
180 | |||
181 | #define FSF_MAX_N_TARGET_WINDOWS 100 |
||
182 | |||
183 | //The cpu time given by the round robin scheduler |
||
184 | //to the threads in the background (timespec) |
||
185 | |||
186 | #define FSF_RR_SLICE_CPU_TIME {0,100000000} //3 0.1 sec |
||
187 | |||
881 | trimarchi | 188 | // This function must be supplied by the user to map the preemption |
189 | // level values given in the contracts for the servers, to priority |
||
190 | // values in the range that is allowed by the present implementation |
||
191 | // for application threads. The value returned by the function must |
||
192 | // fit in the interval defined by the constants: |
||
193 | // [FSF_LOWEST_THREAD_PRIORITY, FSF_HIGHEST_THREAD_PRIORITY] |
||
194 | |||
195 | int |
||
196 | fsf_priority_map (unsigned long plevel); |
||
197 | |||
972 | trimarchi | 198 | // This symbol specifies the maximum number of chars that are stored |
199 | // of a given shared_object_id, so this is the maximum length used |
||
200 | // in comparissons |
||
881 | trimarchi | 201 | |
972 | trimarchi | 202 | #define FSF_MAX_SIZE_SHARED_OBJ_ID 65 |
881 | trimarchi | 203 | |
972 | trimarchi | 204 | |
985 | julio | 205 | //Maximum number of networks accesible from a node |
206 | |||
207 | #define FSF_MAX_N_NETWORK_IDS 1 |
||
208 | |||
209 | //Maximum number of servers that can be given in a servers list |
||
210 | //to the group negotiation/cancellation primitive |
||
211 | |||
212 | #define FSF_MAX_N_SERVER_VALUES 10 |
||
213 | |||
214 | //Maximum number of contracts that can be given in a contracts list |
||
215 | //to the group negotiation/cancellation primitive |
||
216 | |||
217 | #define FSF_MAX_N_CONTRACT_VALUES 10 |
||
218 | |||
881 | trimarchi | 219 | #endif /* _FSF_CONFIGURATION_PARAMETERS_H_ */ |