aboutsummaryrefslogtreecommitdiffstats
path: root/litmus
diff options
context:
space:
mode:
Diffstat (limited to 'litmus')
-rw-r--r--litmus/litmus.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/litmus/litmus.c b/litmus/litmus.c
index 8e7f5e2e68df..ad3d50c78bb1 100644
--- a/litmus/litmus.c
+++ b/litmus/litmus.c
@@ -419,7 +419,7 @@ asmlinkage long sys_set_page_color(int cpu)
419 rcu_read_lock(); 419 rcu_read_lock();
420 list_for_each_entry(lib_page, &shared_lib_pages, list) 420 list_for_each_entry(lib_page, &shared_lib_pages, list)
421 { 421 {
422 if (page_to_pfn(old_page) == lib_page->p_pfn) { 422 if (page_to_pfn(old_page) == lib_page->master_pfn) {
423 is_exist = 1; 423 is_exist = 1;
424 break; 424 break;
425 } 425 }
@@ -428,15 +428,15 @@ asmlinkage long sys_set_page_color(int cpu)
428 428
429 if (is_exist == 0) { 429 if (is_exist == 0) {
430 lib_page = kmalloc(sizeof(struct shared_lib_page), GFP_KERNEL); 430 lib_page = kmalloc(sizeof(struct shared_lib_page), GFP_KERNEL);
431 lib_page->p_page = old_page; 431 lib_page->master_page = old_page;
432 lib_page->r_page = NULL; 432 lib_page->r_page = NULL;
433 lib_page->p_pfn = page_to_pfn(old_page); 433 lib_page->master_pfn = page_to_pfn(old_page);
434 lib_page->r_pfn = INVALID_PFN; 434 lib_page->r_pfn = INVALID_PFN;
435 list_add_tail(&lib_page->list, &shared_lib_pages); 435 list_add_tail(&lib_page->list, &shared_lib_pages);
436 TRACE_TASK(current, "NEW PAGE %ld ADDED.\n", lib_page->p_pfn); 436 TRACE_TASK(current, "NEW PAGE %ld ADDED.\n", lib_page->master_pfn);
437 } 437 }
438 else { 438 else {
439 TRACE_TASK(current, "FOUND PAGE %ld in the list.\n", lib_page->p_pfn); 439 TRACE_TASK(current, "FOUND PAGE %ld in the list.\n", lib_page->master_pfn);
440 } 440 }
441 441
442 /* add to task_shared_pagelist */ 442 /* add to task_shared_pagelist */
@@ -490,6 +490,21 @@ asmlinkage long sys_set_page_color(int cpu)
490 } 490 }
491 } 491 }
492 492
493 {
494 struct list_head *pos, *q;
495 list_for_each_safe(pos, q, &task_shared_pagelist) {
496 struct page *p_entry = NULL;
497 struct shared_lib_page *lib_desc = NULL;
498
499 p_entry = list_entry(pos, struct page, lru);
500 list_for_each_entry(lib_desc, &shared_lib_pages, list) {
501 if (p_entry == lib_desc->r_page) {
502 list_del(pos);
503 }
504 }
505 }
506 }
507
493 if (!list_empty(&task_shared_pagelist)) { 508 if (!list_empty(&task_shared_pagelist)) {
494 ret = replicate_pages(&task_shared_pagelist, new_alloc_page, NULL, node, MIGRATE_SYNC, MR_SYSCALL); 509 ret = replicate_pages(&task_shared_pagelist, new_alloc_page, NULL, node, MIGRATE_SYNC, MR_SYSCALL);
495 TRACE_TASK(current, "%ld shared pages not migrated.\n", ret); 510 TRACE_TASK(current, "%ld shared pages not migrated.\n", ret);
@@ -525,7 +540,7 @@ asmlinkage long sys_set_page_color(int cpu)
525 rcu_read_lock(); 540 rcu_read_lock();
526 list_for_each_entry(lpage, &shared_lib_pages, list) 541 list_for_each_entry(lpage, &shared_lib_pages, list)
527 { 542 {
528 TRACE_TASK(current, "p_PFN = %ld r_PFN = %ld\n", lpage->p_pfn, lpage->r_pfn); 543 TRACE_TASK(current, "master_PFN = %ld r_PFN = %ld PageSwapCache=%d\n", lpage->master_pfn, lpage->r_pfn, PageSwapCache(lpage->master_page));
529 } 544 }
530 rcu_read_unlock(); 545 rcu_read_unlock();
531 } 546 }