diff options
| author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2014-09-08 11:42:49 -0400 |
|---|---|---|
| committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2016-03-16 10:33:08 -0400 |
| commit | 9dcbb55fe1ffda4b5c81cf951d2e6dd4aa743beb (patch) | |
| tree | 888b18a5dd62f59942e9cb0d4bc71fddf32e9530 | |
| parent | 3015c398db2fe6baff8969ef3faf8f6600e3733d (diff) | |
resctl: default to max. priority for table-driven reservations
Table-driven reservations should always have the maximum fixed
priority. Thus default to this behavior, both for convenience and to
avoid accidental misconfiguration.
| -rw-r--r-- | bin/resctl.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/resctl.c b/bin/resctl.c index f5eda85..712d2e3 100644 --- a/bin/resctl.c +++ b/bin/resctl.c | |||
| @@ -21,7 +21,7 @@ const char *usage_msg = | |||
| 21 | " -p PERIOD polling reservation period (in ms, default: 100ms)\n" | 21 | " -p PERIOD polling reservation period (in ms, default: 100ms)\n" |
| 22 | " -d DEADLINE relative deadline, implicit by default (in ms)\n" | 22 | " -d DEADLINE relative deadline, implicit by default (in ms)\n" |
| 23 | " -o OFFSET offset (also known as phase), zero by default (in ms)\n" | 23 | " -o OFFSET offset (also known as phase), zero by default (in ms)\n" |
| 24 | " -q PRIORITY priority to use (EDF by default, max=0)\n" | 24 | " -q PRIORITY priority to use (EDF by default, highest priority = 1)\n" |
| 25 | " -m MAJOR-CYCLE major cycle length (in ms, for table-driven reservations) \n" | 25 | " -m MAJOR-CYCLE major cycle length (in ms, for table-driven reservations) \n" |
| 26 | "\n"; | 26 | "\n"; |
| 27 | 27 | ||
| @@ -156,6 +156,8 @@ int main(int argc, char** argv) | |||
| 156 | 156 | ||
| 157 | case 'q': | 157 | case 'q': |
| 158 | config.priority = atoi(optarg); | 158 | config.priority = atoi(optarg); |
| 159 | if (!config.priority) | ||
| 160 | usage("-q: invalid priority"); | ||
| 159 | break; | 161 | break; |
| 160 | case 'c': | 162 | case 'c': |
| 161 | config.cpu = atoi(optarg); | 163 | config.cpu = atoi(optarg); |
| @@ -182,6 +184,11 @@ int main(int argc, char** argv) | |||
| 182 | res_type = SPORADIC_POLLING; | 184 | res_type = SPORADIC_POLLING; |
| 183 | } else if (strcmp(optarg, "table-driven") == 0) { | 185 | } else if (strcmp(optarg, "table-driven") == 0) { |
| 184 | res_type = TABLE_DRIVEN; | 186 | res_type = TABLE_DRIVEN; |
| 187 | /* Default for table-driven reservations to | ||
| 188 | * maximum priority. EDF has not meaning for | ||
| 189 | * table-driven reservations. */ | ||
| 190 | if (config.priority == LITMUS_NO_PRIORITY) | ||
| 191 | config.priority = LITMUS_HIGHEST_PRIORITY; | ||
| 185 | } else { | 192 | } else { |
| 186 | usage("Unknown reservation type."); | 193 | usage("Unknown reservation type."); |
| 187 | } | 194 | } |
