diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/page_alloc.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index f7da2a2934b7..cefe6fe8d991 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -2606,7 +2606,7 @@ static int default_zonelist_order(void) | |||
2606 | * ZONE_DMA and ZONE_DMA32 can be very small area in the system. | 2606 | * ZONE_DMA and ZONE_DMA32 can be very small area in the system. |
2607 | * If they are really small and used heavily, the system can fall | 2607 | * If they are really small and used heavily, the system can fall |
2608 | * into OOM very easily. | 2608 | * into OOM very easily. |
2609 | * This function detect ZONE_DMA/DMA32 size and confgigures zone order. | 2609 | * This function detect ZONE_DMA/DMA32 size and configures zone order. |
2610 | */ | 2610 | */ |
2611 | /* Is there ZONE_NORMAL ? (ex. ppc has only DMA zone..) */ | 2611 | /* Is there ZONE_NORMAL ? (ex. ppc has only DMA zone..) */ |
2612 | low_kmem_size = 0; | 2612 | low_kmem_size = 0; |
@@ -2618,6 +2618,15 @@ static int default_zonelist_order(void) | |||
2618 | if (zone_type < ZONE_NORMAL) | 2618 | if (zone_type < ZONE_NORMAL) |
2619 | low_kmem_size += z->present_pages; | 2619 | low_kmem_size += z->present_pages; |
2620 | total_size += z->present_pages; | 2620 | total_size += z->present_pages; |
2621 | } else if (zone_type == ZONE_NORMAL) { | ||
2622 | /* | ||
2623 | * If any node has only lowmem, then node order | ||
2624 | * is preferred to allow kernel allocations | ||
2625 | * locally; otherwise, they can easily infringe | ||
2626 | * on other nodes when there is an abundance of | ||
2627 | * lowmem available to allocate from. | ||
2628 | */ | ||
2629 | return ZONELIST_ORDER_NODE; | ||
2621 | } | 2630 | } |
2622 | } | 2631 | } |
2623 | } | 2632 | } |