diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2013-03-13 17:24:27 -0400 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2013-03-13 17:24:27 -0400 |
commit | 020dc974933f4e9459f699625a138c33811eadf6 (patch) | |
tree | d45dbe70b7fc3ce0655baeda609ad452a2840ac2 /gpu | |
parent | 944a78c21028da69fb53c0aec3e9dfdb048d47e4 (diff) | |
parent | 0e71f86251307a37161cf3de2704a59882e25258 (diff) |
Merge branch 'prop/rt_task-init-final' into temp
Conflicts:
bin/base_mt_task.c
bin/rt_launch.c
bin/rtspin.c
include/litmus.h
src/litmus.c
src/task.c
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/dgl.c | 11 | ||||
-rw-r--r-- | gpu/ikglptest.c | 20 | ||||
-rw-r--r-- | gpu/nested.c | 9 | ||||
-rw-r--r-- | gpu/normal_task.c | 10 |
4 files changed, 36 insertions, 14 deletions
@@ -160,14 +160,17 @@ void* rt_thread(void* _ctx) | |||
160 | { | 160 | { |
161 | int i; | 161 | int i; |
162 | int do_exit = 0; | 162 | int do_exit = 0; |
163 | struct rt_task param; | ||
163 | 164 | ||
164 | struct thread_context *ctx = (struct thread_context*)_ctx; | 165 | struct thread_context *ctx = (struct thread_context*)_ctx; |
165 | 166 | ||
166 | TH_CALL( init_rt_thread() ); | 167 | init_rt_task_param(¶m); |
168 | param.exec_cost = EXEC_COST; | ||
169 | param.period = PERIOD + 10*ctx->id; /* Vary period a little bit. */ | ||
170 | param.cls = RT_CLASS_SOFT; | ||
167 | 171 | ||
168 | /* Vary period a little bit. */ | 172 | TH_CALL( init_rt_thread() ); |
169 | TH_CALL( sporadic_task_ns(EXEC_COST, PERIOD + 10*ctx->id, 0, 0, LITMUS_LOWEST_PRIORITY, | 173 | TH_CALL( set_rt_task_param(gettid(), ¶m) ); |
170 | RT_CLASS_SOFT, NO_ENFORCEMENT, NO_SIGNALS, 1) ); | ||
171 | 174 | ||
172 | if (NUM_REPLICAS) { | 175 | if (NUM_REPLICAS) { |
173 | ctx->ikglp = open_ikglp_sem(ctx->fd, 0, NUM_REPLICAS); | 176 | ctx->ikglp = open_ikglp_sem(ctx->fd, 0, NUM_REPLICAS); |
diff --git a/gpu/ikglptest.c b/gpu/ikglptest.c index 30623b7..e5fa6fc 100644 --- a/gpu/ikglptest.c +++ b/gpu/ikglptest.c | |||
@@ -193,6 +193,7 @@ int main(int argc, char** argv) | |||
193 | struct thread_context* aux_ctx = NULL; | 193 | struct thread_context* aux_ctx = NULL; |
194 | pthread_t* task = NULL; | 194 | pthread_t* task = NULL; |
195 | pthread_t* aux_task = NULL; | 195 | pthread_t* aux_task = NULL; |
196 | struct rt_task param; | ||
196 | int fd; | 197 | int fd; |
197 | 198 | ||
198 | int opt; | 199 | int opt; |
@@ -346,9 +347,13 @@ int main(int argc, char** argv) | |||
346 | } | 347 | } |
347 | 348 | ||
348 | if (NUM_AUX_THREADS) { | 349 | if (NUM_AUX_THREADS) { |
350 | init_rt_task_param(¶m); | ||
351 | param.exec_cost = EXEC_COST; | ||
352 | param.period = PERIOD + 10*NUM_THREADS+1; | ||
353 | param.cls = RT_CLASS_SOFT; | ||
354 | |||
349 | TH_CALL( init_rt_thread() ); | 355 | TH_CALL( init_rt_thread() ); |
350 | TH_CALL( sporadic_task_ns(EXEC_COST, PERIOD + 10*NUM_THREADS+1, 0, 0, | 356 | TH_CALL( set_rt_task_param(gettid(), ¶m) ); |
351 | LITMUS_LOWEST_PRIORITY, RT_CLASS_SOFT, NO_ENFORCEMENT, NO_SIGNALS, 1) ); | ||
352 | TH_CALL( task_mode(LITMUS_RT_TASK) ); | 357 | TH_CALL( task_mode(LITMUS_RT_TASK) ); |
353 | 358 | ||
354 | printf("[MASTER] Waiting for TS release.\n "); | 359 | printf("[MASTER] Waiting for TS release.\n "); |
@@ -442,14 +447,17 @@ void* rt_thread(void* _ctx) | |||
442 | int i; | 447 | int i; |
443 | int do_exit = 0; | 448 | int do_exit = 0; |
444 | int last_replica = -1; | 449 | int last_replica = -1; |
450 | struct rt_task param; | ||
445 | 451 | ||
446 | struct thread_context *ctx = (struct thread_context*)_ctx; | 452 | struct thread_context *ctx = (struct thread_context*)_ctx; |
447 | 453 | ||
448 | TH_CALL( init_rt_thread() ); | 454 | init_rt_task_param(¶m); |
455 | param.exec_cost = EXEC_COST; | ||
456 | param.period = PERIOD + 10*ctx->id; /* Vary period a little bit. */ | ||
457 | param.cls = RT_CLASS_SOFT; | ||
449 | 458 | ||
450 | /* Vary period a little bit. */ | 459 | TH_CALL( init_rt_thread() ); |
451 | TH_CALL( sporadic_task_ns(EXEC_COST, PERIOD + 10*ctx->id, 0, 0, | 460 | TH_CALL( set_rt_task_param(gettid(), ¶m) ); |
452 | LITMUS_LOWEST_PRIORITY, RT_CLASS_SOFT, NO_ENFORCEMENT, NO_SIGNALS, 1) ); | ||
453 | 461 | ||
454 | if(USE_KFMLP) { | 462 | if(USE_KFMLP) { |
455 | ctx->kexclu = open_kfmlp_gpu_sem(ctx->fd, | 463 | ctx->kexclu = open_kfmlp_gpu_sem(ctx->fd, |
diff --git a/gpu/nested.c b/gpu/nested.c index edec46b..334de10 100644 --- a/gpu/nested.c +++ b/gpu/nested.c | |||
@@ -145,15 +145,20 @@ void* rt_thread(void* _ctx) | |||
145 | { | 145 | { |
146 | int i; | 146 | int i; |
147 | int do_exit = 0; | 147 | int do_exit = 0; |
148 | struct rt_task param; | ||
148 | 149 | ||
149 | struct thread_context *ctx = (struct thread_context*)_ctx; | 150 | struct thread_context *ctx = (struct thread_context*)_ctx; |
150 | 151 | ||
152 | init_rt_task_param(¶m); | ||
153 | param.exec_cost = EXEC_COST; | ||
154 | param.period = PERIOD + 10*ctx->id; | ||
155 | param.cls = RT_CLASS_SOFT; | ||
156 | |||
151 | /* Make presence visible. */ | 157 | /* Make presence visible. */ |
152 | //printf("RT Thread %d active.\n", ctx->id); | 158 | //printf("RT Thread %d active.\n", ctx->id); |
153 | 159 | ||
154 | TH_CALL( init_rt_thread() ); | 160 | TH_CALL( init_rt_thread() ); |
155 | TH_CALL( sporadic_task_ns(EXEC_COST, PERIOD + 10*ctx->id, 0, 0, | 161 | TH_CALL( set_rt_task_param(gettid(), ¶m) ); |
156 | LITMUS_LOWEST_PRIORITY, RT_CLASS_SOFT, NO_ENFORCEMENT, NO_SIGNALS, 1) ); | ||
157 | 162 | ||
158 | for (i = 0; i < NUM_SEMS; i++) { | 163 | for (i = 0; i < NUM_SEMS; i++) { |
159 | if (!USE_PRIOQ) { | 164 | if (!USE_PRIOQ) { |
diff --git a/gpu/normal_task.c b/gpu/normal_task.c index ffc95b1..ccc265c 100644 --- a/gpu/normal_task.c +++ b/gpu/normal_task.c | |||
@@ -64,11 +64,17 @@ | |||
64 | 64 | ||
65 | int main(int argc, char** argv) | 65 | int main(int argc, char** argv) |
66 | { | 66 | { |
67 | struct rt_task param; | ||
68 | |||
69 | init_rt_task_param(¶m); | ||
70 | param.exec_cost = EXEC_COST; | ||
71 | param.period = PERIOD; | ||
72 | param.cls = RT_CLASS_SOFT; | ||
73 | |||
67 | CALL( init_litmus() ); | 74 | CALL( init_litmus() ); |
68 | 75 | ||
69 | CALL( init_rt_thread() ); | 76 | CALL( init_rt_thread() ); |
70 | CALL( sporadic_task_ns(EXEC_COST, PERIOD, 0, 0, | 77 | CALL( set_rt_task_param(gettid(), ¶m) ); |
71 | LITMUS_LOWEST_PRIORITY, RT_CLASS_SOFT, NO_ENFORCEMENT, NO_SIGNALS, 1) ); | ||
72 | //CALL( task_mode(LITMUS_RT_TASK) ); | 78 | //CALL( task_mode(LITMUS_RT_TASK) ); |
73 | 79 | ||
74 | fprintf(stdout, "Waiting for TS release.\n "); | 80 | fprintf(stdout, "Waiting for TS release.\n "); |