diff options
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index c2e29743a8d1..df54e2fc8ee0 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -878,7 +878,9 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, | |||
878 | mark = (*z)->pages_high; | 878 | mark = (*z)->pages_high; |
879 | if (!zone_watermark_ok(*z, order, mark, | 879 | if (!zone_watermark_ok(*z, order, mark, |
880 | classzone_idx, alloc_flags)) | 880 | classzone_idx, alloc_flags)) |
881 | continue; | 881 | if (!zone_reclaim_mode || |
882 | !zone_reclaim(*z, gfp_mask, order)) | ||
883 | continue; | ||
882 | } | 884 | } |
883 | 885 | ||
884 | page = buffered_rmqueue(zonelist, *z, order, gfp_mask); | 886 | page = buffered_rmqueue(zonelist, *z, order, gfp_mask); |
@@ -1595,13 +1597,22 @@ static void __init build_zonelists(pg_data_t *pgdat) | |||
1595 | prev_node = local_node; | 1597 | prev_node = local_node; |
1596 | nodes_clear(used_mask); | 1598 | nodes_clear(used_mask); |
1597 | while ((node = find_next_best_node(local_node, &used_mask)) >= 0) { | 1599 | while ((node = find_next_best_node(local_node, &used_mask)) >= 0) { |
1600 | int distance = node_distance(local_node, node); | ||
1601 | |||
1602 | /* | ||
1603 | * If another node is sufficiently far away then it is better | ||
1604 | * to reclaim pages in a zone before going off node. | ||
1605 | */ | ||
1606 | if (distance > RECLAIM_DISTANCE) | ||
1607 | zone_reclaim_mode = 1; | ||
1608 | |||
1598 | /* | 1609 | /* |
1599 | * We don't want to pressure a particular node. | 1610 | * We don't want to pressure a particular node. |
1600 | * So adding penalty to the first node in same | 1611 | * So adding penalty to the first node in same |
1601 | * distance group to make it round-robin. | 1612 | * distance group to make it round-robin. |
1602 | */ | 1613 | */ |
1603 | if (node_distance(local_node, node) != | 1614 | |
1604 | node_distance(local_node, prev_node)) | 1615 | if (distance != node_distance(local_node, prev_node)) |
1605 | node_load[node] += load; | 1616 | node_load[node] += load; |
1606 | prev_node = node; | 1617 | prev_node = node; |
1607 | load--; | 1618 | load--; |