From 4594cbad87d09a99555234a8c455ff8a10766719 Mon Sep 17 00:00:00 2001 From: leochanj105 Date: Thu, 28 Oct 2021 19:44:32 -0400 Subject: no more last task deadline misses! --- dag | 11 ++++++++++- extra.h | 36 ++++++++++++++++++++++-------------- run_case_study_dag.py | 2 +- 3 files changed, 33 insertions(+), 16 deletions(-) diff --git a/dag b/dag index 9180799..3027455 100644 --- a/dag +++ b/dag @@ -1 +1,10 @@ -0, localization_qcif, loc001, 100, 15, loc, 1, 50, 1, 0, 50, 50 \ No newline at end of file +0, texture_synthesis_qcif, texture_synthesis_qcif__A, 50, 1, 300, 1, 123, 1, 0, 6, 6 +0, disparity_qcif, disparity_qcif__B, 50, 1, 305, 1, 123, 1, 6, 19, 19 +0, mser_qcif, mser_qcif__C, 50, 1, 306, 1, 123, 1, 24, 7, 7 +0, localization_qcif, localization_qcif__D, 50, 1, 307, 1, 123, 1, 31, 34, 34 +0, sift_qcif, sift_qcif__E, 50, 1, 308, 1, 123, 1, 64, 54, 54 +0, texture_synthesis_qcif, texture_synthesis_qcif__J, 50, 1, 309, 1, 123, 1, 117, 6, 6 +0, stitch_qcif, stitch_qcif__F, 50, 2, 301, 1, 123, 1, 6, 27, 27 +0, tracking_qcif, tracking_qcif__G, 50, 2, 302, 1, 123, 1, 32, 9, 9 +0, svm_qcif, svm_qcif__H, 50, 2, 303, 1, 123, 1, 41, 38, 38 +0, stitch_qcif, stitch_qcif__I, 50, 2, 304, 1, 123, 1, 79, 27, 27 \ No newline at end of file diff --git a/extra.h b/extra.h index 9da536d..a4a3d9c 100644 --- a/extra.h +++ b/extra.h @@ -403,12 +403,12 @@ static void _rt_write_to_file() { } fclose(fp); out: -#if LITMUS - if (task_mode(BACKGROUND_TASK) != 0) { - perror("Unable to become a real-time task"); - exit(1); - } -#endif /* LITMUS */ +// #if LITMUS +// if (task_mode(BACKGROUND_TASK) != 0) { +// perror("Unable to become a real-time task"); +// exit(1); +// } +// #endif /* LITMUS */ #ifdef PAIRED munmap(_rt_barrier, 2); sem_unlink(_rt_sem1_name); @@ -428,7 +428,8 @@ out: // Start a job static void _rt_start_loop() { // Let the first job run before synchrnous release --- make sure we have no further page faults - if(first_job){ + if(first_job == 1){ + // FLUSH_CACHES return; } #if LITMUS @@ -442,7 +443,7 @@ static void _rt_start_loop() { else{ if (sleep_next_period() != 0) { perror("Unable to sleep for next period"); - } + } } // if (last == 0) { @@ -479,7 +480,7 @@ static void _rt_start_loop() { static void _rt_stop_loop() { clock_gettime(CLOCK_MONOTONIC, &_rt_end); // Set first_job == 0 - if(first_job){ + if(first_job == 1){ first_job = 0; return; } @@ -493,13 +494,20 @@ static void _rt_stop_loop() { long long end = _rt_end_time[_rt_jobs_complete]; if (end > _rt_cp->deadline) { fprintf(stderr, "(%s/%d:%lu) ", _rt_our_prog_name, gettid(), _rt_cp->job_index); - fprintf(stderr, " tardy %llu ns, " - "relative tardiness %f\n", - end - _rt_cp->deadline, - (end - _rt_cp->deadline) / (double)_rt_deadline); + fprintf(stderr, "tardy %llu ns, relative tardiness %f\n", end - _rt_cp->deadline, (end - _rt_cp->deadline) / (double)_rt_deadline); } #endif - _rt_jobs_complete++; + _rt_jobs_complete++; +#if LITMUS + if(_rt_jobs_complete == _rt_max_jobs){ + // fprintf(stderr, "complete %s: %d\n" , _rt_our_prog_name, _rt_jobs_complete); + if (task_mode(BACKGROUND_TASK) != 0) { + perror("Unable to become background task"); + exit(1); + } + } +#endif + } /****** New API ****** diff --git a/run_case_study_dag.py b/run_case_study_dag.py index 716c89b..65314a8 100755 --- a/run_case_study_dag.py +++ b/run_case_study_dag.py @@ -99,7 +99,7 @@ def main(pathName): ### Allocate Cache Ways ### run('mount -t resctrl resctrl /sys/fs/resctrl') # run('sudo echo "L3:0=0000;1=0000;2=0000;3=ffff" | sudo tee /sys/fs/resctrl/schemata') - run('sudo echo "L3:0=0000;1=0000;2=0000;3=000f" | sudo tee /sys/fs/resctrl/schemata') + # run('sudo echo "L3:0=0000;1=0000;2=0000;3=000f" | sudo tee /sys/fs/resctrl/schemata') for core in range(16): if core not in all_cores: continue -- cgit v1.2.2