aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mmzone.h
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2012-01-25 06:49:24 -0500
committerMarek Szyprowski <m.szyprowski@samsung.com>2012-05-21 09:09:36 -0400
commit49f223a9cd96c7293d7258ff88c2bdf83065f69c (patch)
tree4a141cbe4132ab2a5edfbc44165d091bb2289c75 /include/linux/mmzone.h
parentbba9071087108d3de70bea274e35064cc480487b (diff)
mm: trigger page reclaim in alloc_contig_range() to stabilise watermarks
alloc_contig_range() performs memory allocation so it also should keep track on keeping the correct level of memory watermarks. This commit adds a call to *_slowpath style reclaim to grab enough pages to make sure that the final collection of contiguous pages from freelists will not starve the system. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> CC: Michal Nazarewicz <mina86@mina86.com> Tested-by: Rob Clark <rob.clark@linaro.org> Tested-by: Ohad Ben-Cohen <ohad@wizery.com> Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Tested-by: Robert Nelson <robertcnelson@gmail.com> Tested-by: Barry Song <Baohua.Song@csr.com>
Diffstat (limited to 'include/linux/mmzone.h')
-rw-r--r--include/linux/mmzone.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 8c1335f3c3a..26f2040b8b0 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -63,8 +63,10 @@ enum {
63 63
64#ifdef CONFIG_CMA 64#ifdef CONFIG_CMA
65# define is_migrate_cma(migratetype) unlikely((migratetype) == MIGRATE_CMA) 65# define is_migrate_cma(migratetype) unlikely((migratetype) == MIGRATE_CMA)
66# define cma_wmark_pages(zone) zone->min_cma_pages
66#else 67#else
67# define is_migrate_cma(migratetype) false 68# define is_migrate_cma(migratetype) false
69# define cma_wmark_pages(zone) 0
68#endif 70#endif
69 71
70#define for_each_migratetype_order(order, type) \ 72#define for_each_migratetype_order(order, type) \
@@ -371,6 +373,13 @@ struct zone {
371 /* see spanned/present_pages for more description */ 373 /* see spanned/present_pages for more description */
372 seqlock_t span_seqlock; 374 seqlock_t span_seqlock;
373#endif 375#endif
376#ifdef CONFIG_CMA
377 /*
378 * CMA needs to increase watermark levels during the allocation
379 * process to make sure that the system is not starved.
380 */
381 unsigned long min_cma_pages;
382#endif
374 struct free_area free_area[MAX_ORDER]; 383 struct free_area free_area[MAX_ORDER];
375 384
376#ifndef CONFIG_SPARSEMEM 385#ifndef CONFIG_SPARSEMEM