summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuri Lelli <juri.lelli@gmail.com>2014-01-31 14:07:36 +0100
committerJuri Lelli <juri.lelli@gmail.com>2014-01-31 14:07:36 +0100
commit024f4f08e9c8df15569f2b9ff334a451e506ce43 (patch)
tree5d7640b7158cc2a4d0268fd9095b6eeac9876bf8
parentce393a8ecb3cb3265005685c032ee4cce39e68e5 (diff)
reset sched_flags
-rw-r--r--libdl/dl_syscalls.h2
-rw-r--r--src/rt-app.c25
2 files changed, 13 insertions, 14 deletions
diff --git a/libdl/dl_syscalls.h b/libdl/dl_syscalls.h
index 1865519..29d3f63 100644
--- a/libdl/dl_syscalls.h
+++ b/libdl/dl_syscalls.h
@@ -48,8 +48,6 @@
#define RLIMIT_DLDLINE 16
#define RLIMIT_DLRTIME 17
-#define SCHED_ATTR_SIZE_VER0 48
-
struct sched_attr {
__u32 size;
diff --git a/src/rt-app.c b/src/rt-app.c
index eb5a54b..605a662 100644
--- a/src/rt-app.c
+++ b/src/rt-app.c
@@ -215,25 +215,15 @@ void *thread_body(void *arg)
#ifdef DLSCHED
case deadline:
tid = gettid();
- attr.size = SCHED_ATTR_SIZE_VER0;
+ attr.size = sizeof(attr);
+ attr.sched_flags = 0;
attr.sched_policy = SCHED_DEADLINE;
attr.sched_priority = 0;
attr.sched_runtime = timespec_to_nsec(&data->max_et) +
(timespec_to_nsec(&data->max_et) /100) * BUDGET_OVERP;
attr.sched_deadline = timespec_to_nsec(&data->period);
attr.sched_period = timespec_to_nsec(&data->period);
- /* not implemented inside SCHED_DEADLINE V4 */
- /* data->dl_params.sched_flags = SCHED_BWRECL_RT; */
-
- log_notice("[%d] starting thread with period: %lu, exec: %lu,"
- "deadline: %lu, priority: %d",
- data->ind,
- timespec_to_usec(&data->period),
- timespec_to_usec(&data->min_et),
- timespec_to_usec(&data->deadline),
- data->sched_prio
- );
break;
#endif
@@ -288,10 +278,21 @@ void *thread_body(void *arg)
* budget as little as possible for the first iteration.
*/
if (data->sched_policy == SCHED_DEADLINE) {
+ log_notice("[%d] starting thread with period: %lu, exec: %lu,"
+ "deadline: %lu, priority: %d",
+ data->ind,
+ attr.sched_period / 1000,
+ attr.sched_runtime / 1000,
+ attr.sched_deadline / 1000,
+ attr.sched_priority
+ );
+
ret = sched_setattr(tid, &attr);
if (ret != 0) {
log_critical("[%d] sched_setattr "
"returned %d", data->ind, ret);
+ errno = ret;
+ perror("sched_setattr");
exit(EXIT_FAILURE);
}
}