aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNamhoon Kim <namhoonk@cs.unc.edu>2017-04-21 13:32:48 -0400
committerNamhoon Kim <namhoonk@cs.unc.edu>2017-04-21 13:32:48 -0400
commitba55436349e1a0d41964966430e9c65eff35b1dc (patch)
tree415610ba733d6b82f668a701ae239ecf1603e620
parent30a3723e4c29f642de114d5a0518bbaf2f23adcd (diff)
cleanup for posting
-rw-r--r--litmus/bank_proc.c19
-rw-r--r--litmus/litmus.c4
-rw-r--r--litmus/sched_mc2.c9
3 files changed, 8 insertions, 24 deletions
diff --git a/litmus/bank_proc.c b/litmus/bank_proc.c
index 55f0f70476f1..67a5e71c0da7 100644
--- a/litmus/bank_proc.c
+++ b/litmus/bank_proc.c
@@ -218,8 +218,6 @@ void add_page_to_color_list(struct page *page)
218 */ 218 */
219static int do_add_pages(void) 219static int do_add_pages(void)
220{ 220{
221 //printk("LITMUS do add pages\n");
222
223 struct page *page, *page_tmp; 221 struct page *page, *page_tmp;
224 LIST_HEAD(free_later); 222 LIST_HEAD(free_later);
225 unsigned long color; 223 unsigned long color;
@@ -228,16 +226,11 @@ static int do_add_pages(void)
228 int free_counter = 0; 226 int free_counter = 0;
229 unsigned long counter[128]= {0}; 227 unsigned long counter[128]= {0};
230 228
231 //printk("Before refill : \n");
232 //show_nr_pages();
233
234 // until all the page lists contain enough pages 229 // until all the page lists contain enough pages
235 //for (i =0; i<5; i++) {
236 for (i=0; i< 1024*50;i++) { 230 for (i=0; i< 1024*50;i++) {
237 //while (smallest_nr_pages() < PAGES_PER_COLOR) { 231 //while (smallest_nr_pages() < PAGES_PER_COLOR) {
238 // printk("smallest = %d\n", smallest_nr_pages()); 232 // printk("smallest = %d\n", smallest_nr_pages());
239 page = alloc_page(GFP_HIGHUSER_MOVABLE); 233 page = alloc_page(GFP_HIGHUSER_MOVABLE);
240 // page = alloc_pages_exact_node(0, GFP_HIGHUSER_MOVABLE, 0);
241 234
242 if (unlikely(!page)) { 235 if (unlikely(!page)) {
243 printk(KERN_WARNING "Could not allocate pages.\n"); 236 printk(KERN_WARNING "Could not allocate pages.\n");
@@ -305,7 +298,7 @@ out:
305 * This function should not be accessed by others directly. 298 * This function should not be accessed by others directly.
306 * 299 *
307 */ 300 */
308static struct page *new_alloc_page_color( unsigned long color) 301static struct page *new_alloc_page_color( unsigned long color)
309{ 302{
310// printk("allocate new page color = %d\n", color); 303// printk("allocate new page color = %d\n", color);
311 struct color_group *cgroup; 304 struct color_group *cgroup;
@@ -369,15 +362,15 @@ struct page *new_alloc_page(struct page *page, unsigned long node, int **x)
369 int try = 0; 362 int try = 0;
370 363
371 364
372 unsigned int idx = 0; 365 unsigned int idx = 0;
373 idx += num_by_bitmask_index(set_partition[node], set_index[node]); 366 idx += num_by_bitmask_index(set_partition[node], set_index[node]);
374 idx += number_cachecolors* num_by_bitmask_index(bank_partition[node], bank_index[node]); 367 idx += number_cachecolors* num_by_bitmask_index(bank_partition[node], bank_index[node]);
375 //printk("node = %d, idx = %d\n", node, idx); 368 //printk("node = %d, idx = %d\n", node, idx);
376 369
377 rPage = new_alloc_page_color(idx); 370 rPage = new_alloc_page_color(idx);
378 371
379 set_index[node] = (set_index[node]+1) % counting_one_set(set_partition[node]); 372 set_index[node] = (set_index[node]+1) % counting_one_set(set_partition[node]);
380 bank_index[node] = (bank_index[node]+1) % counting_one_set(bank_partition[node]); 373 bank_index[node] = (bank_index[node]+1) % counting_one_set(bank_partition[node]);
381 while (!rPage) { 374 while (!rPage) {
382 try++; 375 try++;
383 if (try>=64) 376 if (try>=64)
diff --git a/litmus/litmus.c b/litmus/litmus.c
index 4f7c6450b464..129f74740480 100644
--- a/litmus/litmus.c
+++ b/litmus/litmus.c
@@ -477,11 +477,10 @@ asmlinkage long sys_set_page_color(int cpu)
477 TRACE_TASK(current, "nr_pages = %d nr_failed = %d\n", nr_pages, nr_failed); 477 TRACE_TASK(current, "nr_pages = %d nr_failed = %d\n", nr_pages, nr_failed);
478 printk(KERN_INFO "node = %ld, nr_migrated_pages = %d, nr_shared_pages = %d, nr_failed = %d\n", node, nr_pages-nr_not_migrated, nr_failed-2, nr_failed); 478 printk(KERN_INFO "node = %ld, nr_migrated_pages = %d, nr_shared_pages = %d, nr_failed = %d\n", node, nr_pages-nr_not_migrated, nr_failed-2, nr_failed);
479 //printk(KERN_INFO "node = %d\n", cpu_to_node(smp_processor_id())); 479 //printk(KERN_INFO "node = %d\n", cpu_to_node(smp_processor_id()));
480 //flush_cache(1);
481 return ret; 480 return ret;
482} 481}
483 482
484/* sys_test_call() is a test system call for developing */ 483/* sys_test_call() is a test system call for debugging */
485asmlinkage long sys_test_call(unsigned int param) 484asmlinkage long sys_test_call(unsigned int param)
486{ 485{
487 long ret = 0; 486 long ret = 0;
@@ -521,7 +520,6 @@ asmlinkage long sys_test_call(unsigned int param)
521 } 520 }
522 else if (param == 1) { 521 else if (param == 1) {
523 int i; 522 int i;
524 //flush_cache(1);
525 for (i = 0; i < 4; i++) { 523 for (i = 0; i < 4; i++) {
526 lock_cache(i, 0x00003fff); 524 lock_cache(i, 0x00003fff);
527 } 525 }
diff --git a/litmus/sched_mc2.c b/litmus/sched_mc2.c
index 21c616f9c9ba..aa3d999d60ed 100644
--- a/litmus/sched_mc2.c
+++ b/litmus/sched_mc2.c
@@ -134,10 +134,8 @@ asmlinkage long sys_enact_mode(void)
134 struct reservation *res; 134 struct reservation *res;
135 struct list_head *pos; 135 struct list_head *pos;
136 unsigned long flags; 136 unsigned long flags;
137 //lt_t now = litmus_clock();
138 TRACE_TASK(current, "ENACTING SYSCALL\n"); 137 TRACE_TASK(current, "ENACTING SYSCALL\n");
139 if (state->cpu == 0){ 138 if (state->cpu == 0){
140 //preempt_disable();
141 mode_changed = false; 139 mode_changed = false;
142 local_irq_save(flags); 140 local_irq_save(flags);
143 if (pending){ //MCR has entered 141 if (pending){ //MCR has entered
@@ -148,7 +146,6 @@ asmlinkage long sys_enact_mode(void)
148 if (!seen_once){ 146 if (!seen_once){
149 TRACE_TASK(current, "REQUEST\n"); 147 TRACE_TASK(current, "REQUEST\n");
150 sched_trace_request_mode(current); 148 sched_trace_request_mode(current);
151 //TS_MODE_CHANGE_START;
152 //clean up jobs that are already done 149 //clean up jobs that are already done
153 //after this jobs report themselves 150 //after this jobs report themselves
154 list_for_each(pos, &_global_env->active_reservations){ 151 list_for_each(pos, &_global_env->active_reservations){
@@ -172,7 +169,7 @@ asmlinkage long sys_enact_mode(void)
172 res = list_entry(pos, struct reservation, list); 169 res = list_entry(pos, struct reservation, list);
173 if (tsk_rt(res->tsk)->completed && res->mode == mode && !res->reported){ 170 if (tsk_rt(res->tsk)->completed && res->mode == mode && !res->reported){
174 res->reported = 1; 171 res->reported = 1;
175 //TRACE_CUR("R%d RES_REPORTED_INACTIVE = %d mode %d\n", res->id, res_reported, res->mode); 172 TRACE_CUR("R%d RES_REPORTED_INACTIVE = %d mode %d\n", res->id, res_reported, res->mode);
176 res_reported--; 173 res_reported--;
177 } 174 }
178 } 175 }
@@ -220,9 +217,7 @@ asmlinkage long sys_enact_mode(void)
220 } 217 }
221 sup_update_time(state->sup_env, litmus_clock()); 218 sup_update_time(state->sup_env, litmus_clock());
222 //raw_spin_unlock(&state->lock); 219 //raw_spin_unlock(&state->lock);
223 //t=litmus_clock();
224 sched_trace_enact_mode(current); 220 sched_trace_enact_mode(current);
225 //TS_MODE_CHANGE_END;
226 TRACE("ENACT\n"); 221 TRACE("ENACT\n");
227 } 222 }
228 raw_spin_unlock(&mode_lock); 223 raw_spin_unlock(&mode_lock);
@@ -259,7 +254,6 @@ asmlinkage long sys_enact_mode(void)
259 //TRACE("CPU%d mode changed\n",state->cpu); 254 //TRACE("CPU%d mode changed\n",state->cpu);
260 hrtimer_cancel(&state->timer); //stop listening to old mode timers 255 hrtimer_cancel(&state->timer); //stop listening to old mode timers
261 TRACE("Timer is cancelled at %llu. mode-change\n", litmus_clock()); 256 TRACE("Timer is cancelled at %llu. mode-change\n", litmus_clock());
262 //preempt_disable();
263 //local_irq_save(flags); 257 //local_irq_save(flags);
264 raw_spin_lock(&state->lock); 258 raw_spin_lock(&state->lock);
265 state->sup_env = &state->sup_env_modes[mode]; 259 state->sup_env = &state->sup_env_modes[mode];
@@ -280,7 +274,6 @@ asmlinkage long sys_enact_mode(void)
280 mc2_update_timer_and_unlock(state); 274 mc2_update_timer_and_unlock(state);
281 //local_irq_restore(flags); 275 //local_irq_restore(flags);
282 276
283 //preempt_enable();
284 } 277 }
285 this_cpu_write(mode_counter, *cpu0_counter); 278 this_cpu_write(mode_counter, *cpu0_counter);
286 local_irq_restore(flags); 279 local_irq_restore(flags);