rk: mm: CMA memory busy error may have a variety of reasons, in the larger one is:
authorCMY <cmy@rock-chips.com>
Fri, 11 Jul 2014 07:13:38 +0000 (15:13 +0800)
committerCMY <cmy@rock-chips.com>
Fri, 11 Jul 2014 07:17:00 +0000 (15:17 +0800)
the pages being used in the system come from CMA, and now need recycling
them for new CMA allocation, it need to allocate a new page for storing data
that will be reclaim CMA's pages, but new page may also be come from CMA memory
when memory allocate fall back to MIGRATE_CMA freelist.

Now we protect the CMA's pages in the memory fallback allocate

[ 1637.058550] alloc_contig_range test_pages_isolated(431a0, 431c0) failed

mm/page_alloc.c

index 4cfdc64482c85a59dc3e242ef793bcbfb5456315..699bd7742877fa9387c31914dc0560246a4b5533 100644 (file)
@@ -1050,6 +1050,15 @@ __rmqueue_fallback(struct zone *zone, int order, int start_migratetype)
 
                        page = list_entry(area->free_list[migratetype].next,
                                        struct page, lru);
+
+#ifdef CONFIG_ARCH_ROCKCHIP
+                       if (is_migrate_cma(migratetype)){
+                               int mt = get_pageblock_migratetype(page);
+                               if (unlikely(is_migrate_isolate(mt)))
+                                       continue;
+                       }
+#endif
+
                        area->nr_free--;
 
                        /*