The patch titled Subject: mm/cma.c: free the reserved memblock when free cma pages has been added to the -mm tree. Its filename is free-the-reserved-memblock-when-free-cma-pages.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/free-the-reserved-memblock-when-free-cma-pages.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/free-the-reserved-memblock-when-free-cma-pages.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: "Wang, Yalin" <Yalin.Wang@xxxxxxxxxxxxxx> Subject: mm/cma.c: free the reserved memblock when free cma pages Add memblock_free to also free the reserved memblock, so that the cma pages are not marked as reserved memory in /sys/kernel/debug/memblock/reserved debug file Cc: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@xxxxxxxxxxx> Acked-by: Minchan Kim <minchan@xxxxxxxxxx> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/cma.c | 6 +++++- mm/page_alloc.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff -puN mm/cma.c~free-the-reserved-memblock-when-free-cma-pages mm/cma.c --- a/mm/cma.c~free-the-reserved-memblock-when-free-cma-pages +++ a/mm/cma.c @@ -217,7 +217,11 @@ int __init cma_declare_contiguous(phys_a goto err; } - /* Reserve memory */ + /* + * Reserve memory, and the reserved memory are marked as reserved by + * memblock driver, remember to clear the reserved status when free + * these cma pages, see init_cma_reserved_pageblock() + */ if (base && fixed) { if (memblock_is_region_reserved(base, size) || memblock_reserve(base, size) < 0) { diff -puN mm/page_alloc.c~free-the-reserved-memblock-when-free-cma-pages mm/page_alloc.c --- a/mm/page_alloc.c~free-the-reserved-memblock-when-free-cma-pages +++ a/mm/page_alloc.c @@ -835,8 +835,8 @@ void __init init_cma_reserved_pageblock( set_page_refcounted(page); __free_pages(page, pageblock_order); } - adjust_managed_page_count(page, pageblock_nr_pages); + memblock_free(page_to_phys(page), pageblock_nr_pages << PAGE_SHIFT); } #endif _ Patches currently in -mm which might be from Yalin.Wang@xxxxxxxxxxxxxx are free-the-reserved-memblock-when-free-cma-pages.patch linux-next.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html