Re: [RFC] Free the reserved memblock when free cma pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 12, 2014 at 11:35:49AM +0200, Marek Szyprowski wrote:
> Hello,
> 
> On 2014-09-09 08:13, Wang, Yalin wrote:
> >This patch 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
> >
> >Signed-off-by: Yalin Wang <yalin.wang@xxxxxxxxxxxxxx>
> 
> Acked-by: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>
> 
> >---
> >  mm/cma.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> >diff --git a/mm/cma.c b/mm/cma.c
> >index c17751c..f3ec756 100644
> >--- a/mm/cma.c
> >+++ b/mm/cma.c
> >@@ -114,6 +114,8 @@ static int __init cma_activate_area(struct cma *cma)
> >  				goto err;
> >  		}
> >  		init_cma_reserved_pageblock(pfn_to_page(base_pfn));
> >+		memblock_free(__pfn_to_phys(base_pfn),
> >+				pageblock_nr_pages * PAGE_SIZE);
> >  	} while (--i);
> >  	mutex_init(&cma->lock);
> 
> Right. Thanks for fixing this issue. When cma_activate_area() is
> called noone
> should use memblock to allocate memory, but it is ok to call memblock_free()
> to update memblock statistics, so users won't be confused by cma entries in
> /sys/kernel/debug/memblock/reserved file.

Maybe some comment on code would be very helpful.

Thanks.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]