aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorMichal Nazarewicz <mina86@mina86.com>2012-01-11 09:31:33 -0500
committerMarek Szyprowski <m.szyprowski@samsung.com>2012-05-21 09:09:31 -0400
commit6d4a49160de2c684fb59fa627bce80e200224331 (patch)
tree942b758d78d7ce94569369f12f680488d467eb95 /mm/page_alloc.c
parent041d3a8cdc18dc375a128d90bbb753949a81b1fb (diff)
mm: page_alloc: change fallbacks array handling
This commit adds a row for MIGRATE_ISOLATE type to the fallbacks array which was missing from it. It also, changes the array traversal logic a little making MIGRATE_RESERVE an end marker. The letter change, removes the implicit MIGRATE_UNMOVABLE from the end of each row which was read by __rmqueue_fallback() function. Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Mel Gorman <mel@csn.ul.ie> Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.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 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 2c38a30d064e..d6b580c660f5 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -875,11 +875,12 @@ struct page *__rmqueue_smallest(struct zone *zone, unsigned int order,
875 * This array describes the order lists are fallen back to when 875 * This array describes the order lists are fallen back to when
876 * the free lists for the desirable migrate type are depleted 876 * the free lists for the desirable migrate type are depleted
877 */ 877 */
878static int fallbacks[MIGRATE_TYPES][MIGRATE_TYPES-1] = { 878static int fallbacks[MIGRATE_TYPES][3] = {
879 [MIGRATE_UNMOVABLE] = { MIGRATE_RECLAIMABLE, MIGRATE_MOVABLE, MIGRATE_RESERVE }, 879 [MIGRATE_UNMOVABLE] = { MIGRATE_RECLAIMABLE, MIGRATE_MOVABLE, MIGRATE_RESERVE },
880 [MIGRATE_RECLAIMABLE] = { MIGRATE_UNMOVABLE, MIGRATE_MOVABLE, MIGRATE_RESERVE }, 880 [MIGRATE_RECLAIMABLE] = { MIGRATE_UNMOVABLE, MIGRATE_MOVABLE, MIGRATE_RESERVE },
881 [MIGRATE_MOVABLE] = { MIGRATE_RECLAIMABLE, MIGRATE_UNMOVABLE, MIGRATE_RESERVE }, 881 [MIGRATE_MOVABLE] = { MIGRATE_RECLAIMABLE, MIGRATE_UNMOVABLE, MIGRATE_RESERVE },
882 [MIGRATE_RESERVE] = { MIGRATE_RESERVE, MIGRATE_RESERVE, MIGRATE_RESERVE }, /* Never used */ 882 [MIGRATE_RESERVE] = { MIGRATE_RESERVE }, /* Never used */
883 [MIGRATE_ISOLATE] = { MIGRATE_RESERVE }, /* Never used */
883}; 884};
884 885
885/* 886/*
@@ -974,12 +975,12 @@ __rmqueue_fallback(struct zone *zone, int order, int start_migratetype)
974 /* Find the largest possible block of pages in the other list */ 975 /* Find the largest possible block of pages in the other list */
975 for (current_order = MAX_ORDER-1; current_order >= order; 976 for (current_order = MAX_ORDER-1; current_order >= order;
976 --current_order) { 977 --current_order) {
977 for (i = 0; i < MIGRATE_TYPES - 1; i++) { 978 for (i = 0;; i++) {
978 migratetype = fallbacks[start_migratetype][i]; 979 migratetype = fallbacks[start_migratetype][i];
979 980
980 /* MIGRATE_RESERVE handled later if necessary */ 981 /* MIGRATE_RESERVE handled later if necessary */
981 if (migratetype == MIGRATE_RESERVE) 982 if (migratetype == MIGRATE_RESERVE)
982 continue; 983 break;
983 984
984 area = &(zone->free_area[current_order]); 985 area = &(zone->free_area[current_order]);
985 if (list_empty(&area->free_list[migratetype])) 986 if (list_empty(&area->free_list[migratetype]))