summaryrefslogtreecommitdiff
path: root/src/rt-app.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt-app.c')
-rw-r--r--src/rt-app.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/rt-app.c b/src/rt-app.c
index 99f60e5..cb6d31d 100644
--- a/src/rt-app.c
+++ b/src/rt-app.c
@@ -252,12 +252,18 @@ void *thread_body(void *arg)
"\tBudget\tUsed Budget\n");
#ifdef DLSCHED
- ret = sched_setscheduler2(tid, SCHED_DEADLINE,
- &param2);
- if (ret != 0) {
- log_critical("[%d] sched_setscheduler2 "
- "returned %d", data->ind, ret);
- exit(EXIT_FAILURE);
+ /*
+ * Set the task to SCHED_DEADLINE as far as possible touching its
+ * budget as little as possible for the first iteration.
+ */
+ if (data->sched_policy == SCHED_DEADLINE) {
+ ret = sched_setscheduler2(tid, SCHED_DEADLINE,
+ &param2);
+ if (ret != 0) {
+ log_critical("[%d] sched_setscheduler2 "
+ "returned %d", data->ind, ret);
+ exit(EXIT_FAILURE);
+ }
}
#endif