diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2014-09-08 11:42:49 -0400 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2014-09-08 11:42:49 -0400 |
commit | d7d397d028d6c755cff140f2ef54537f608d3e62 (patch) | |
tree | dff46c8e3a2f93c96592b0cb5aa4e9b6a5deb08a | |
parent | a2675ecbfb665f5f9de5f541d7d22c6710b4ff97 (diff) |
resctrl: 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/resctrl.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/resctrl.c b/bin/resctrl.c index 917f49a..63b5054 100644 --- a/bin/resctrl.c +++ b/bin/resctrl.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 | } |