[PATCH 1/2] mm/cma: provide option to opt out from exposing pages on activation failure

Hari Bathini hbathini at linux.ibm.com
Wed Jan 12 20:50:29 AEDT 2022



On 11/01/22 8:06 pm, David Hildenbrand wrote:
> On 06.01.22 13:01, Hari Bathini wrote:
>>
>> To answer the question, fadump does not want the memory to be used for
>> kernel pages, if CMA activation fails...
> 
> Okay, so what you want is a reserved region, and if possible, let CMA
> use that memory for other (movable allocation) purposes until you
> actually need that area and free it up by using CMA. If CMA cannot use
> the region because of zone issues, you just want that region to stay
> reserved.
> 

Right.

> I guess the biggest different to other CMA users is that it can make use
> of the memory even if not allocated via CMA -- because it's going to
> make use of the the physical memory range indirectly via a HW facility,
> not via any "struct page" access.
> 
> 
> I wonder if we can make the terminology a bit clearer, the freeing part
> is a bit confusing, because init_cma_reserved_pageblock() essentially
> also frees pages, just to the MIGRATE_CMA lists ... what you want is to
> treat it like a simple memblock allocation/reservation on error.

> What about:
> * cma->reserve_pages_on_error that defaults to false
> * void __init cma_reserve_pages_on_error(struct cma *cma)

Yeah, this change does make things bit more clearer.
Will send out a v2 with the change..



More information about the Linuxppc-dev mailing list