aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNamhoon Kim <namhoonk@cs.unc.edu>2017-09-12 16:18:20 -0400
committerNamhoon Kim <namhoonk@cs.unc.edu>2017-09-12 16:18:20 -0400
commit7ce89fa17531c28b08f03b37bcfd3eeb505aab10 (patch)
tree3f766be984541476be59b05c30b8936e2cddb840
parent5cc515b26848d31deda903fc19e5534723cf4a35 (diff)
bug fixed. working
-rw-r--r--mm/page_alloc.c54
1 files changed, 21 insertions, 33 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 2d49e44c7cb8..805c4f598b8c 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1202,25 +1202,17 @@ struct page *__rmqueue_smallest(struct zone *zone, unsigned int order,
1202 continue; 1202 continue;
1203 } 1203 }
1204 1204
1205 1205 list_for_each_entry(page, &area->free_list[migratetype], lru) {
1206 { 1206 printk(KERN_INFO "__rmqueue_smallest list entry %p color %d\n", page, page_color(page));
1207 list_for_each_entry(page, &area->free_list[migratetype], lru) { 1207 if (is_in_llc_partition(page, cpu) && (page_to_pfn(page) >= s_pfn && page_to_pfn(page) < e_pfn)) {
1208 printk(KERN_INFO "__rmqueue_smallest list entry %p color %d\n", page, page_color(page)); 1208 found = 1;
1209 break;
1209 } 1210 }
1210 } 1211 }
1211 printk(KERN_INFO "__rmqueue_smallest LAST list entry %p\n", page); 1212 printk(KERN_INFO "__rmqueue_smallest LAST list entry %p\n", page);
1212 1213
1213 page = list_entry(area->free_list[migratetype].next, 1214 if (!found)
1214 struct page, lru); 1215 return NULL;
1215 if (is_in_llc_partition(page, cpu))
1216 found = 1;
1217
1218 while(!found) {
1219 page = list_next_entry(page, lru);
1220 if (is_in_llc_partition(page, cpu) && (page_to_pfn(page) >= s_pfn && page_to_pfn(page) < e_pfn))
1221 found = 1;
1222 }
1223 BUG_ON(found == 0);
1224 1216
1225 list_del(&page->lru); 1217 list_del(&page->lru);
1226 rmv_page_order(page); 1218 rmv_page_order(page);
@@ -1472,6 +1464,9 @@ __rmqueue_fallback(struct zone *zone, unsigned int order, int start_migratetype,
1472 if (color_req == 1) { 1464 if (color_req == 1) {
1473 int cpu = raw_smp_processor_id(); 1465 int cpu = raw_smp_processor_id();
1474 int found = 0; 1466 int found = 0;
1467 unsigned long s_pfn = zone->zone_start_pfn;
1468 unsigned long e_pfn = zone_end_pfn(zone);
1469
1475 /* Find the largest possible block of pages in the other list */ 1470 /* Find the largest possible block of pages in the other list */
1476 for (current_order = MAX_PARTITIONED_ORDER-1; 1471 for (current_order = MAX_PARTITIONED_ORDER-1;
1477 current_order >= order && current_order <= MAX_PARTITIONED_ORDER-1; 1472 current_order >= order && current_order <= MAX_PARTITIONED_ORDER-1;
@@ -1481,25 +1476,18 @@ __rmqueue_fallback(struct zone *zone, unsigned int order, int start_migratetype,
1481 start_migratetype, false, &can_steal); 1476 start_migratetype, false, &can_steal);
1482 if (fallback_mt == -1) 1477 if (fallback_mt == -1)
1483 continue; 1478 continue;
1484 1479
1485/* 1480 list_for_each_entry(page, &area->free_list[fallback_mt], lru) {
1486 { 1481 printk(KERN_INFO "__rmqueue_falback list entry %p color %d\n", page, page_color(page));
1487 list_for_each_entry(page, &area->free_list[fallback_mt], lru) { 1482 if (is_in_llc_partition(page, cpu) && (page_to_pfn(page) >= s_pfn && page_to_pfn(page) < e_pfn)) {
1488 printk(KERN_INFO "__rmqueue_fallback list entry %p color %d\n", page, page_color(page)); 1483 found = 1;
1484 break;
1489 } 1485 }
1490 } 1486 }
1491*/ 1487 printk(KERN_INFO "__rmqueue_falback LAST list entry %p\n", page);
1492 1488
1493 page = list_entry(area->free_list[fallback_mt].next, 1489 if (!found)
1494 struct page, lru); 1490 return NULL;
1495 if (is_in_llc_partition(page, cpu))
1496 found = 1;
1497
1498 while(!found) {
1499 page = list_next_entry(page, lru);
1500 if (is_in_llc_partition(page, cpu))
1501 found = 1;
1502 }
1503 1491
1504 if (can_steal) 1492 if (can_steal)
1505 steal_suitable_fallback(zone, page, start_migratetype); 1493 steal_suitable_fallback(zone, page, start_migratetype);