Merge pull request #181 from gwsystems/emil-feedback

fix: Limit granularity check to admissions control
main
Sean McBride 4 years ago committed by GitHub
commit 7023b42ba7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -488,9 +488,6 @@ module_new_from_json(char *file_name)
} }
i += ntoks; i += ntoks;
/* If the ratio is too big, admissions control is too coarse */
uint32_t ratio = relative_deadline_us / expected_execution_us;
if (ratio > 1000000) panic("Ratio of Deadline to Execution time cannot exceed 1000000");
/* Validate presence of required fields */ /* Validate presence of required fields */
if (strlen(module_name) == 0) panic("name field is required\n"); if (strlen(module_name) == 0) panic("name field is required\n");
@ -501,6 +498,13 @@ module_new_from_json(char *file_name)
/* expected-execution-us and relative-deadline-us are required in case of admissions control */ /* expected-execution-us and relative-deadline-us are required in case of admissions control */
if (expected_execution_us == 0) panic("expected-execution-us is required\n"); if (expected_execution_us == 0) panic("expected-execution-us is required\n");
if (relative_deadline_us == 0) panic("relative_deadline_us is required\n"); if (relative_deadline_us == 0) panic("relative_deadline_us is required\n");
/* If the ratio is too big, admissions control is too coarse */
uint32_t ratio = relative_deadline_us / expected_execution_us;
if (ratio > ADMISSIONS_CONTROL_GRANULARITY)
panic("Ratio of Deadline to Execution time cannot exceed admissions control granularity of "
"%d\n",
ADMISSIONS_CONTROL_GRANULARITY);
#else #else
/* relative-deadline-us is required if scheduler is EDF */ /* relative-deadline-us is required if scheduler is EDF */
if (runtime_scheduler == RUNTIME_SCHEDULER_EDF && relative_deadline_us == 0) if (runtime_scheduler == RUNTIME_SCHEDULER_EDF && relative_deadline_us == 0)

Loading…
Cancel
Save