diff options
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 62c122528587..234bd4895d14 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -590,21 +590,20 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order, | |||
590 | } | 590 | } |
591 | 591 | ||
592 | #ifdef CONFIG_NUMA | 592 | #ifdef CONFIG_NUMA |
593 | /* Called from the slab reaper to drain remote pagesets */ | 593 | /* |
594 | void drain_remote_pages(void) | 594 | * Called from the slab reaper to drain pagesets on a particular node that |
595 | * belong to the currently executing processor. | ||
596 | */ | ||
597 | void drain_node_pages(int nodeid) | ||
595 | { | 598 | { |
596 | struct zone *zone; | 599 | int i, z; |
597 | int i; | ||
598 | unsigned long flags; | 600 | unsigned long flags; |
599 | 601 | ||
600 | local_irq_save(flags); | 602 | local_irq_save(flags); |
601 | for_each_zone(zone) { | 603 | for (z = 0; z < MAX_NR_ZONES; z++) { |
604 | struct zone *zone = NODE_DATA(nodeid)->node_zones + z; | ||
602 | struct per_cpu_pageset *pset; | 605 | struct per_cpu_pageset *pset; |
603 | 606 | ||
604 | /* Do not drain local pagesets */ | ||
605 | if (zone->zone_pgdat->node_id == numa_node_id()) | ||
606 | continue; | ||
607 | |||
608 | pset = zone_pcp(zone, smp_processor_id()); | 607 | pset = zone_pcp(zone, smp_processor_id()); |
609 | for (i = 0; i < ARRAY_SIZE(pset->pcp); i++) { | 608 | for (i = 0; i < ARRAY_SIZE(pset->pcp); i++) { |
610 | struct per_cpu_pages *pcp; | 609 | struct per_cpu_pages *pcp; |
@@ -1015,7 +1014,7 @@ rebalance: | |||
1015 | if (page) | 1014 | if (page) |
1016 | goto got_pg; | 1015 | goto got_pg; |
1017 | 1016 | ||
1018 | out_of_memory(gfp_mask, order); | 1017 | out_of_memory(zonelist, gfp_mask, order); |
1019 | goto restart; | 1018 | goto restart; |
1020 | } | 1019 | } |
1021 | 1020 | ||
@@ -1541,29 +1540,29 @@ static int __initdata node_load[MAX_NUMNODES]; | |||
1541 | */ | 1540 | */ |
1542 | static int __init find_next_best_node(int node, nodemask_t *used_node_mask) | 1541 | static int __init find_next_best_node(int node, nodemask_t *used_node_mask) |
1543 | { | 1542 | { |
1544 | int i, n, val; | 1543 | int n, val; |
1545 | int min_val = INT_MAX; | 1544 | int min_val = INT_MAX; |
1546 | int best_node = -1; | 1545 | int best_node = -1; |
1547 | 1546 | ||
1548 | for_each_online_node(i) { | 1547 | /* Use the local node if we haven't already */ |
1549 | cpumask_t tmp; | 1548 | if (!node_isset(node, *used_node_mask)) { |
1549 | node_set(node, *used_node_mask); | ||
1550 | return node; | ||
1551 | } | ||
1550 | 1552 | ||
1551 | /* Start from local node */ | 1553 | for_each_online_node(n) { |
1552 | n = (node+i) % num_online_nodes(); | 1554 | cpumask_t tmp; |
1553 | 1555 | ||
1554 | /* Don't want a node to appear more than once */ | 1556 | /* Don't want a node to appear more than once */ |
1555 | if (node_isset(n, *used_node_mask)) | 1557 | if (node_isset(n, *used_node_mask)) |
1556 | continue; | 1558 | continue; |
1557 | 1559 | ||
1558 | /* Use the local node if we haven't already */ | ||
1559 | if (!node_isset(node, *used_node_mask)) { | ||
1560 | best_node = node; | ||
1561 | break; | ||
1562 | } | ||
1563 | |||
1564 | /* Use the distance array to find the distance */ | 1560 | /* Use the distance array to find the distance */ |
1565 | val = node_distance(node, n); | 1561 | val = node_distance(node, n); |
1566 | 1562 | ||
1563 | /* Penalize nodes under us ("prefer the next node") */ | ||
1564 | val += (n < node); | ||
1565 | |||
1567 | /* Give preference to headless and unused nodes */ | 1566 | /* Give preference to headless and unused nodes */ |
1568 | tmp = node_to_cpumask(n); | 1567 | tmp = node_to_cpumask(n); |
1569 | if (!cpus_empty(tmp)) | 1568 | if (!cpus_empty(tmp)) |