diff options
author | Leo Chan <leochanj@live.unc.edu> | 2020-10-22 01:53:21 -0400 |
---|---|---|
committer | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-22 01:56:35 -0400 |
commit | d17b33131c14864bd1eae275f49a3f148e21cf29 (patch) | |
tree | 0d8f77922e8d193cb0f6edab83018f057aad64a0 /extra.h | |
parent | 601ed25a4c5b66cb75315832c15613a727db2c26 (diff) |
Squashed commit of the sb-vbs branch.
Includes the SD-VBS benchmarks modified to:
- Use libextra to loop as realtime jobs
- Preallocate memory before starting their main computation
- Accept input via stdin instead of via argc
Does not include the SD-VBS matlab code.
Fixes libextra execution in LITMUS^RT.
Diffstat (limited to 'extra.h')
-rw-r--r-- | extra.h | 27 |
1 files changed, 3 insertions, 24 deletions
@@ -29,7 +29,7 @@ extern int sched_getcpu(); | |||
29 | #include <sys/syscall.h> | 29 | #include <sys/syscall.h> |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | #define LITMUS 0 | 32 | #define LITMUS 1 |
33 | #define MC2 0 | 33 | #define MC2 0 |
34 | #define MMDC_PROF 0 | 34 | #define MMDC_PROF 0 |
35 | 35 | ||
@@ -200,20 +200,6 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
200 | perror("Unable to migrate to specified CPU"); \ | 200 | perror("Unable to migrate to specified CPU"); \ |
201 | exit(1); \ | 201 | exit(1); \ |
202 | } \ | 202 | } \ |
203 | struct reservation_config res; \ | ||
204 | res.id = gettid(); \ | ||
205 | res.cpu = cpu; \ | ||
206 | res.priority = LITMUS_HIGHEST_PRIORITY; \ | ||
207 | /* we take over half the CPU time (these are ns) */ \ | ||
208 | res.polling_params.budget = ms2ns(3000); \ | ||
209 | res.polling_params.period = ms2ns(3000); \ | ||
210 | res.polling_params.offset = 0; \ | ||
211 | res.polling_params.relative_deadline = ms2ns(3000); \ | ||
212 | /* Not 100% sure that we should use periodic polling */ \ | ||
213 | if (reservation_create(PERIODIC_POLLING, &res) < 0) { \ | ||
214 | perror("Unable to create reservation"); \ | ||
215 | exit(1); \ | ||
216 | } \ | ||
217 | struct rt_task rt_param; \ | 203 | struct rt_task rt_param; \ |
218 | init_rt_task_param(&rt_param); \ | 204 | init_rt_task_param(&rt_param); \ |
219 | /* Supposedly the next two parameters are irrelevant when reservations are enabled, but I'm leaving them anyway... */ \ | 205 | /* Supposedly the next two parameters are irrelevant when reservations are enabled, but I'm leaving them anyway... */ \ |
@@ -223,7 +209,7 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
223 | rt_param.cls = RT_CLASS_HARD; \ | 209 | rt_param.cls = RT_CLASS_HARD; \ |
224 | rt_param.release_policy = TASK_PERIODIC; \ | 210 | rt_param.release_policy = TASK_PERIODIC; \ |
225 | rt_param.budget_policy = NO_ENFORCEMENT; \ | 211 | rt_param.budget_policy = NO_ENFORCEMENT; \ |
226 | rt_param.cpu = cpu; \ | 212 | rt_param.cpu = _rt_core; \ |
227 | if (set_rt_task_param(gettid(), &rt_param) < 0) { \ | 213 | if (set_rt_task_param(gettid(), &rt_param) < 0) { \ |
228 | perror("Unable to set real-time parameters"); \ | 214 | perror("Unable to set real-time parameters"); \ |
229 | exit(1); \ | 215 | exit(1); \ |
@@ -244,13 +230,7 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
244 | 230 | ||
245 | #if MC2 | 231 | #if MC2 |
246 | #define MC2_SETUP \ | 232 | #define MC2_SETUP \ |
247 | struct mc2_task mc2_param; \ | 233 | |
248 | mc2_param.res_id = gettid(); \ | ||
249 | mc2_param.crit = CRIT_LEVEL_A; \ | ||
250 | if (set_mc2_task_param(gettid(), &mc2_param) < 0) { \ | ||
251 | perror("Unable to set MC^2 task params"); \ | ||
252 | exit(1); \ | ||
253 | } \ | ||
254 | set_page_color(rt_param.cpu); | 234 | set_page_color(rt_param.cpu); |
255 | #else | 235 | #else |
256 | #define MC2_SETUP | 236 | #define MC2_SETUP |
@@ -261,7 +241,6 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
261 | perror("Unable to become a real-time task"); \ | 241 | perror("Unable to become a real-time task"); \ |
262 | exit(1); \ | 242 | exit(1); \ |
263 | } \ | 243 | } \ |
264 | reservation_destroy(gettid(), rt_param.cpu); | ||
265 | 244 | ||
266 | #if __arm__ | 245 | #if __arm__ |
267 | // On ARM, manually flush the cache | 246 | // On ARM, manually flush the cache |