diff options
| -rw-r--r-- | all_pairs/Makefile | 2 | ||||
| -rw-r--r-- | baseline/Makefile | 2 | ||||
| -rwxr-xr-x | dis/Makefile | 2 | ||||
| -rw-r--r-- | extra.h | 58 | ||||
| -rw-r--r-- | run_case_study.py | 28 |
5 files changed, 30 insertions, 62 deletions
diff --git a/all_pairs/Makefile b/all_pairs/Makefile index 592db70..5eef323 100644 --- a/all_pairs/Makefile +++ b/all_pairs/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | LIBLITMUS ?= /playpen/mc2/liblitmus | 1 | LIBLITMUS ?= /home/litmus/liblitmus |
| 2 | CC ?= gcc | 2 | CC ?= gcc |
| 3 | override CFLAGS += -pthread -O2 -I.. -DPAIRED | 3 | override CFLAGS += -pthread -O2 -I.. -DPAIRED |
| 4 | LDFLAGS += -lrt | 4 | LDFLAGS += -lrt |
diff --git a/baseline/Makefile b/baseline/Makefile index a929bc6..1d90c7f 100644 --- a/baseline/Makefile +++ b/baseline/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | LIBLITMUS ?= /playpen/mc2/liblitmus | 1 | LIBLITMUS ?= /home/litmus/liblitmus |
| 2 | CC ?= gcc | 2 | CC ?= gcc |
| 3 | override CFLAGS = -pthread -O2 -I.. | 3 | override CFLAGS = -pthread -O2 -I.. |
| 4 | LDFLAGS = -lrt | 4 | LDFLAGS = -lrt |
diff --git a/dis/Makefile b/dis/Makefile index d18761b..77e0b8a 100755 --- a/dis/Makefile +++ b/dis/Makefile | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | # Build the DIS benchmarks with all-pairs or unpaired instrumentation | 2 | # Build the DIS benchmarks with all-pairs or unpaired instrumentation |
| 3 | # (I know that this Makefile is mildly evil and breaks so many rules | 3 | # (I know that this Makefile is mildly evil and breaks so many rules |
| 4 | # that a good Makefile should follow. Sorry - at least I have one.) | 4 | # that a good Makefile should follow. Sorry - at least I have one.) |
| 5 | LIBLITMUS ?= /playpen/mc2/liblitmus | 5 | LIBLITMUS ?= /home/litmus/liblitmus |
| 6 | CC ?= gcc | 6 | CC ?= gcc |
| 7 | override CFLAGS += -pthread -O2 -I.. | 7 | override CFLAGS += -pthread -O2 -I.. |
| 8 | LDFLAGS = -lrt -lm | 8 | LDFLAGS = -lrt -lm |
| @@ -29,13 +29,8 @@ extern int sched_getcpu(); | |||
| 29 | #include <sys/syscall.h> | 29 | #include <sys/syscall.h> |
| 30 | #endif | 30 | #endif |
| 31 | 31 | ||
| 32 | <<<<<<< HEAD | ||
| 33 | #define LITMUS 1 | ||
| 34 | #define MC2 0 | ||
| 35 | ======= | ||
| 36 | // This is a proxy for "case study mode" now | 32 | // This is a proxy for "case study mode" now |
| 37 | #define LITMUS 0 | 33 | #define LITMUS 1 |
| 38 | >>>>>>> rtas20-wip | ||
| 39 | #define MMDC_PROF 0 | 34 | #define MMDC_PROF 0 |
| 40 | 35 | ||
| 41 | #if LITMUS | 36 | #if LITMUS |
| @@ -269,57 +264,6 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
| 269 | mmdc->madpcr1 = axi_arm1;\ | 264 | mmdc->madpcr1 = axi_arm1;\ |
| 270 | msync(&(mmdc->madpcr1),4,MS_SYNC); | 265 | msync(&(mmdc->madpcr1),4,MS_SYNC); |
| 271 | 266 | ||
| 272 | <<<<<<< HEAD | ||
| 273 | #define SETUP_LITMUS \ | ||
| 274 | unsigned int wait = 0; \ | ||
| 275 | if (be_migrate_to_domain(_rt_core) < 0) { \ | ||
| 276 | perror("Unable to migrate to specified CPU"); \ | ||
| 277 | exit(1); \ | ||
| 278 | } \ | ||
| 279 | struct rt_task rt_param; \ | ||
| 280 | init_rt_task_param(&rt_param); \ | ||
| 281 | /* Supposedly the next two parameters are irrelevant when reservations are enabled, but I'm leaving them anyway... */ \ | ||
| 282 | rt_param.exec_cost = ms2ns(999); \ | ||
| 283 | rt_param.period = ms2ns(1000); \ | ||
| 284 | rt_param.priority = LITMUS_HIGHEST_PRIORITY; \ | ||
| 285 | rt_param.cls = RT_CLASS_HARD; \ | ||
| 286 | rt_param.release_policy = TASK_PERIODIC; \ | ||
| 287 | rt_param.budget_policy = NO_ENFORCEMENT; \ | ||
| 288 | rt_param.cpu = _rt_core; \ | ||
| 289 | if (set_rt_task_param(gettid(), &rt_param) < 0) { \ | ||
| 290 | perror("Unable to set real-time parameters"); \ | ||
| 291 | exit(1); \ | ||
| 292 | } \ | ||
| 293 | if (init_litmus() != 0) { \ | ||
| 294 | perror("init_litmus failed"); \ | ||
| 295 | exit(1); \ | ||
| 296 | } \ | ||
| 297 | MC2_SETUP \ | ||
| 298 | if (task_mode(LITMUS_RT_TASK) != 0) { \ | ||
| 299 | perror("Unable to become real-time task"); \ | ||
| 300 | exit(1); \ | ||
| 301 | } \ | ||
| 302 | if (wait && wait_for_ts_release() != 0) { \ | ||
| 303 | perror("Unable to wait for taskset release"); \ | ||
| 304 | exit(1); \ | ||
| 305 | } | ||
| 306 | |||
| 307 | #if MC2 | ||
| 308 | #define MC2_SETUP \ | ||
| 309 | |||
| 310 | set_page_color(rt_param.cpu); | ||
| 311 | #else | ||
| 312 | #define MC2_SETUP | ||
| 313 | #endif | ||
| 314 | |||
| 315 | #define CLEANUP_LITMUS \ | ||
| 316 | if (task_mode(BACKGROUND_TASK) != 0) { \ | ||
| 317 | perror("Unable to become a real-time task"); \ | ||
| 318 | exit(1); \ | ||
| 319 | } \ | ||
| 320 | |||
| 321 | ======= | ||
| 322 | >>>>>>> rtas20-wip | ||
| 323 | #if __arm__ | 267 | #if __arm__ |
| 324 | // On ARM, manually flush the cache | 268 | // On ARM, manually flush the cache |
| 325 | #define FLUSH_CACHES \ | 269 | #define FLUSH_CACHES \ |
diff --git a/run_case_study.py b/run_case_study.py index b960d38..d715644 100644 --- a/run_case_study.py +++ b/run_case_study.py | |||
| @@ -28,8 +28,32 @@ def main(): | |||
| 28 | if line > 0: | 28 | if line > 0: |
| 29 | levelC.append(row) | 29 | levelC.append(row) |
| 30 | line += 1 | 30 | line += 1 |
| 31 | #os.system('echo "L3:0=L3:0=0000,1=0000,2=0000,3=0000" > /sys/fs/resctrl/schemata') | ||
| 31 | 32 | ||
| 32 | for task in all_tasks: | 33 | with open(pathName+"/l3alloc.csv", "r") as csv_file: |
| 33 | print(task[0]) | 34 | csv_reader = csv.reader(csv_file, delimiter = ',') |
| 35 | line = 0 | ||
| 36 | ccx = 0 | ||
| 37 | for row in csv_reader: | ||
| 38 | if line > 0: | ||
| 39 | core = int(row[0]) | ||
| 40 | way_AB = int(row[1]) | ||
| 41 | way_C = int(row[3]) | ||
| 42 | # Level C allocation | ||
| 43 | if(core == 1): | ||
| 44 | os.system("mkdir /sys/fs/resctrl/level-c-ccx-0") | ||
| 45 | os.system('echo "L3:0=' + ("%0.4x" % (int("1"*way_C, 2))) + ',1=0000,2=0000,3=0000" > /sys/fs/resctrl/level-c-ccx-0/schemata') | ||
| 46 | |||
| 47 | if(core == 4): | ||
| 48 | os.system("mkdir /sys/fs/resctrl/level-c-ccx-1") | ||
| 49 | os.system('echo "L3:0=0000, 1=' + ("%0.4x" % (int("1"*way_C, 2))) + ',2=0000,3=0000" > /sys/fs/resctrl/level-c-ccx-0/schemata') | ||
| 50 | os.system('mkdir /sys/fs/resctrl/level-ab-core-' + core) | ||
| 51 | if(core < 4): | ||
| 52 | os.system('echo "L3:0=' + ("%0.4x" % (int("1"*way_C + "0"*(16-way_AB), 2))) + ',1=0000,2=0000,3=0000" > /sys/fs/resctrl/level-ab-core-' + core + '/schemata') | ||
| 53 | else: | ||
| 54 | os.system('echo "L3:0=0000,1=' + ("%0.4x" % (int("1"*way_C + "0"*(16-way_AB), 2))) + ',2=0000,3=0000" > /sys/fs/resctrl/level-ab-core-' + core + '/schemata') | ||
| 55 | for task in levelAB: | ||
| 56 | |||
| 57 | #os.system("ls") | ||
| 34 | if __name__ == "__main__": | 58 | if __name__ == "__main__": |
| 35 | main() | 59 | main() |
