diff options
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index cd88a860f088..95ad42de5a87 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -1769,7 +1769,7 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order, | |||
1769 | { | 1769 | { |
1770 | struct page *page; | 1770 | struct page *page; |
1771 | 1771 | ||
1772 | if (!order) | 1772 | if (!order || compaction_deferred(preferred_zone)) |
1773 | return NULL; | 1773 | return NULL; |
1774 | 1774 | ||
1775 | *did_some_progress = try_to_compact_pages(zonelist, order, gfp_mask, | 1775 | *did_some_progress = try_to_compact_pages(zonelist, order, gfp_mask, |
@@ -1785,6 +1785,8 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order, | |||
1785 | alloc_flags, preferred_zone, | 1785 | alloc_flags, preferred_zone, |
1786 | migratetype); | 1786 | migratetype); |
1787 | if (page) { | 1787 | if (page) { |
1788 | preferred_zone->compact_considered = 0; | ||
1789 | preferred_zone->compact_defer_shift = 0; | ||
1788 | count_vm_event(COMPACTSUCCESS); | 1790 | count_vm_event(COMPACTSUCCESS); |
1789 | return page; | 1791 | return page; |
1790 | } | 1792 | } |
@@ -1795,6 +1797,7 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order, | |||
1795 | * but not enough to satisfy watermarks. | 1797 | * but not enough to satisfy watermarks. |
1796 | */ | 1798 | */ |
1797 | count_vm_event(COMPACTFAIL); | 1799 | count_vm_event(COMPACTFAIL); |
1800 | defer_compaction(preferred_zone); | ||
1798 | 1801 | ||
1799 | cond_resched(); | 1802 | cond_resched(); |
1800 | } | 1803 | } |