From e0217a963c6c0e0667d41d075038685956bcfacf Mon Sep 17 00:00:00 2001 From: leochanj Date: Fri, 23 Oct 2020 02:11:48 -0400 Subject: wip --- all_pairs/Makefile | 2 +- baseline/Makefile | 2 +- dis/Makefile | 2 +- extra.h | 58 +----------------------------------------------------- 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 @@ -LIBLITMUS ?= /playpen/mc2/liblitmus +LIBLITMUS ?= /home/litmus/liblitmus CC ?= gcc override CFLAGS += -pthread -O2 -I.. -DPAIRED LDFLAGS += -lrt diff --git a/baseline/Makefile b/baseline/Makefile index a929bc6..1d90c7f 100644 --- a/baseline/Makefile +++ b/baseline/Makefile @@ -1,4 +1,4 @@ -LIBLITMUS ?= /playpen/mc2/liblitmus +LIBLITMUS ?= /home/litmus/liblitmus CC ?= gcc override CFLAGS = -pthread -O2 -I.. LDFLAGS = -lrt diff --git a/dis/Makefile b/dis/Makefile index d18761b..77e0b8a 100755 --- a/dis/Makefile +++ b/dis/Makefile @@ -2,7 +2,7 @@ # Build the DIS benchmarks with all-pairs or unpaired instrumentation # (I know that this Makefile is mildly evil and breaks so many rules # that a good Makefile should follow. Sorry - at least I have one.) -LIBLITMUS ?= /playpen/mc2/liblitmus +LIBLITMUS ?= /home/litmus/liblitmus CC ?= gcc override CFLAGS += -pthread -O2 -I.. LDFLAGS = -lrt -lm diff --git a/extra.h b/extra.h index 8c894f6..3f1df9d 100644 --- a/extra.h +++ b/extra.h @@ -29,13 +29,8 @@ extern int sched_getcpu(); #include #endif -<<<<<<< HEAD -#define LITMUS 1 -#define MC2 0 -======= // This is a proxy for "case study mode" now -#define LITMUS 0 ->>>>>>> rtas20-wip +#define LITMUS 1 #define MMDC_PROF 0 #if LITMUS @@ -269,57 +264,6 @@ static void _rt_load_params_itrl(int argc, char **argv) { mmdc->madpcr1 = axi_arm1;\ msync(&(mmdc->madpcr1),4,MS_SYNC); -<<<<<<< HEAD -#define SETUP_LITMUS \ - unsigned int wait = 0; \ - if (be_migrate_to_domain(_rt_core) < 0) { \ - perror("Unable to migrate to specified CPU"); \ - exit(1); \ - } \ - struct rt_task rt_param; \ - init_rt_task_param(&rt_param); \ - /* Supposedly the next two parameters are irrelevant when reservations are enabled, but I'm leaving them anyway... */ \ - rt_param.exec_cost = ms2ns(999); \ - rt_param.period = ms2ns(1000); \ - rt_param.priority = LITMUS_HIGHEST_PRIORITY; \ - rt_param.cls = RT_CLASS_HARD; \ - rt_param.release_policy = TASK_PERIODIC; \ - rt_param.budget_policy = NO_ENFORCEMENT; \ - rt_param.cpu = _rt_core; \ - if (set_rt_task_param(gettid(), &rt_param) < 0) { \ - perror("Unable to set real-time parameters"); \ - exit(1); \ - } \ - if (init_litmus() != 0) { \ - perror("init_litmus failed"); \ - exit(1); \ - } \ - MC2_SETUP \ - if (task_mode(LITMUS_RT_TASK) != 0) { \ - perror("Unable to become real-time task"); \ - exit(1); \ - } \ - if (wait && wait_for_ts_release() != 0) { \ - perror("Unable to wait for taskset release"); \ - exit(1); \ - } - -#if MC2 -#define MC2_SETUP \ - - set_page_color(rt_param.cpu); -#else -#define MC2_SETUP -#endif - -#define CLEANUP_LITMUS \ - if (task_mode(BACKGROUND_TASK) != 0) { \ - perror("Unable to become a real-time task"); \ - exit(1); \ - } \ - -======= ->>>>>>> rtas20-wip #if __arm__ // On ARM, manually flush the cache #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(): if line > 0: levelC.append(row) line += 1 + #os.system('echo "L3:0=L3:0=0000,1=0000,2=0000,3=0000" > /sys/fs/resctrl/schemata') - for task in all_tasks: - print(task[0]) + with open(pathName+"/l3alloc.csv", "r") as csv_file: + csv_reader = csv.reader(csv_file, delimiter = ',') + line = 0 + ccx = 0 + for row in csv_reader: + if line > 0: + core = int(row[0]) + way_AB = int(row[1]) + way_C = int(row[3]) + # Level C allocation + if(core == 1): + os.system("mkdir /sys/fs/resctrl/level-c-ccx-0") + 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') + + if(core == 4): + os.system("mkdir /sys/fs/resctrl/level-c-ccx-1") + 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') + os.system('mkdir /sys/fs/resctrl/level-ab-core-' + core) + if(core < 4): + 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') + else: + 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') + for task in levelAB: + + #os.system("ls") if __name__ == "__main__": main() -- cgit v1.2.2