Rev 889 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
881 | trimarchi | 1 | //fsf_configuration_parameters.h |
2 | //=============================================================== |
||
3 | // FFFFFFIII RRRRR SSTTTTTTT |
||
4 | // FF IIR RR SS |
||
5 | // FF IR SS |
||
6 | // FFFFFF RRRR SSSSST |
||
7 | // FF FI RRR SS |
||
8 | // FF II RRR SS |
||
9 | // FF IIIIIR RS |
||
10 | // |
||
11 | // Basic FSF(FIRST Scheduling Framework) configuration parameters |
||
12 | //============================================================== |
||
13 | |||
14 | ////////////////////////////////////////////////////// |
||
15 | // Definitions required to configure the fsf |
||
16 | // scheduling algorithms. |
||
17 | |||
18 | #include <sys/boolean.h> |
||
19 | |||
20 | #ifndef _FSF_CONFIGURATION_PARAMETERS_H_ |
||
21 | #define _FSF_CONFIGURATION_PARAMETERS_H_ |
||
22 | |||
23 | // This symbol specifies whether the scheduler will make a |
||
24 | // schedulability test of the requested contract or not |
||
25 | |||
26 | #define FSF_ADMISSION_TEST_IS_ENABLED true |
||
27 | |||
28 | |||
29 | // Tune these values for optimizing the amount of memory used by the |
||
30 | // implementation |
||
31 | |||
32 | // Maximum number of accepted contracts (servers) |
||
33 | |||
34 | #define FSF_MAX_N_SERVERS 10 |
||
35 | |||
36 | |||
37 | // Maximum number of threads that may be scheduled by the framework |
||
38 | |||
39 | #define FSF_MAX_N_THREADS 11 |
||
40 | |||
41 | |||
42 | // Maximum number of critical sections that can be stored in a |
||
43 | // contract parameters object |
||
44 | |||
45 | #define FSF_MAX_N_CRITICAL_SECTIONS 10 |
||
46 | |||
47 | |||
48 | // Maximum number of utilization values (pairs of budget and period) |
||
49 | // that can be stored in a contract parameters object |
||
50 | |||
51 | #define FSF_MAX_N_UTILIZATION_VALUES 5 |
||
52 | |||
53 | |||
54 | // Maximum number of synchronization objects |
||
55 | |||
56 | #define FSF_MAX_N_SYNCH_OBJECTS 5 |
||
57 | |||
58 | |||
59 | // Maximum number of shared objects |
||
60 | |||
61 | #define FSF_MAX_N_SHARED_OBJECTS 100 |
||
62 | |||
63 | |||
64 | //////////////////////////////////////////// |
||
65 | // Other implementation dependent parameters |
||
66 | |||
67 | // The current implementation in MaRTE OS uses the Application-Defined |
||
68 | // Scheduling Interface (proposed to the POSIX standardization |
||
69 | // committee), to create a fixed-priority-based scheduler that |
||
70 | // operates under the rules of the FIRST scheduling framework. |
||
71 | |||
72 | // In this implementation there are two special threads: |
||
73 | // - The application scheduler thread, that |
||
74 | // implements the scheduler |
||
75 | |||
76 | // - The service thread, that is in charge of |
||
77 | // negotiating and renegotiating contracts |
||
78 | // concurrently with the application |
||
79 | |||
80 | // The following symbols are necessary to adapt the application to the |
||
81 | // underlying fixed priority scheduler |
||
82 | |||
83 | // Priority assigned to the application scheduler; it should be above |
||
84 | // the priorities of the application threads and of the service |
||
85 | // thread, and it should be at least 1 level below the maximum of the |
||
86 | // system |
||
87 | |||
88 | #define FSF_SCHEDULER_PRIORITY 30 |
||
89 | |||
90 | |||
91 | // Real-time signal number reserved for the application scheduler to |
||
92 | // manage its timers. |
||
93 | |||
94 | #define FSF_SCHEDULER_SIGNAL SIGRTMIN |
||
95 | |||
96 | |||
97 | // The highest priority that can be assigned to an application thread, |
||
98 | // it should be defined as one level less than the |
||
99 | // FSF_SCHEDULER_PRIORITY |
||
100 | |||
101 | #define FSF_HIGHEST_THREAD_PRIORITY FSF_SCHEDULER_PRIORITY-1 |
||
102 | |||
103 | |||
104 | // The lowest priority that can be assigned to an application thread, |
||
105 | // it should be at least 1 level above the minimum of the system |
||
106 | |||
107 | #define FSF_LOWEST_THREAD_PRIORITY 2 |
||
108 | |||
109 | // Each call to the functions that negotiate or renegotiate a contract |
||
110 | // or that change the quality and importance generates a request for |
||
111 | // the service thread that we call a service job. This job will be |
||
112 | // pending in a queue until executed by the service thread. The |
||
113 | // following symbol represents the maximum number of requests that can |
||
114 | // be simultaneously queued. |
||
115 | #define FSF_MAX_N_SERVICE_JOBS FSF_MAX_N_SERVERS * 2 |
||
116 | |||
117 | // In order to bound the background activity of the scheduler (i.e., |
||
118 | // the admission tests necessary for the negotiation and |
||
119 | // re-negotiation of contracts), a service thread has been defined. It |
||
120 | // runs at a given priority level and has a budget and period |
||
121 | // assigned. |
||
122 | |||
123 | |||
124 | // Initial period of the service thread (timespec) |
||
125 | |||
126 | #define FSF_SERVICE_THREAD_PERIOD {0,100000000} //0.1 seg |
||
127 | |||
128 | |||
129 | // Initial budget of the service thread (timespec) |
||
130 | |||
131 | #define FSF_SERVICE_THREAD_BUDGET {0,10000000} //0.01 seg |
||
132 | |||
133 | |||
134 | // Initial priority of the service thread, it has to be lower than the |
||
135 | // FSF_SCHEDULER_PRIORITY, and is set according to its period and the |
||
136 | // expected response times for reconfiguration or tunning of the |
||
137 | // system. |
||
138 | |||
139 | #define FSF_SERVICE_THREAD_PRIORITY 1 |
||
140 | |||
141 | |||
142 | // Numeric identifier of the service thread, used for tracing |
||
143 | |||
144 | #define FSF_SERVICE_THREAD_IDNAME 0x55555555 |
||
145 | |||
146 | |||
147 | //Maximum number of servers that can be simultaneusly waiting for |
||
148 | //being signaled in a synchronization object |
||
149 | |||
150 | #define FSF_MAX_N_SERVERS_IN_SYNCH_OBJECT 4 |
||
151 | |||
152 | |||
153 | //Maximum number of events that can be pending to be signaled in a |
||
154 | //synchronization object |
||
155 | |||
156 | #define FSF_MAX_N_EVENTS_IN_SYNCH_OBJECT 100 |
||
157 | |||
158 | |||
159 | //Maximum number of pending replenishments in each sporadic server |
||
160 | |||
161 | #define FSF_MAX_N_PENDING_REPLENISHMENTS 25 |
||
162 | |||
163 | |||
164 | // This function must be supplied by the user to map the preemption |
||
165 | // level values given in the contracts for the servers, to priority |
||
166 | // values in the range that is allowed by the present implementation |
||
167 | // for application threads. The value returned by the function must |
||
168 | // fit in the interval defined by the constants: |
||
169 | // [FSF_LOWEST_THREAD_PRIORITY, FSF_HIGHEST_THREAD_PRIORITY] |
||
170 | |||
171 | int |
||
172 | fsf_priority_map (unsigned long plevel); |
||
173 | |||
174 | // This symbol specifies whether the scheduling system will make |
||
175 | // traces of the servers, the scheduler and the service thread |
||
176 | // operation and make them available through the fsf_print_traces |
||
177 | // function |
||
178 | |||
179 | #define FSF_TRACING_SERVICE_IS_ENABLED true |
||
180 | |||
181 | |||
182 | #endif /* _FSF_CONFIGURATION_PARAMETERS_H_ */ |