Re: [PATCH] mm,page_alloc,cma: configurable CMA utilization

From: Roman Gushchin
Date: Fri Feb 03 2023 - 19:05:13 EST


On Thu, Feb 02, 2023 at 12:13:02PM -0800, Sukadev Bhattiprolu wrote:
>
> Hi Roman,
>
> On Wed, Feb 01, 2023 at 11:00:25AM -0800, Roman Gushchin wrote:
> > Then _maybe_ a new knob is justified, at least I don't have better ideas.
> > Rik, do you have any input here?
> >
> > Let's then define it in a more generic way and _maybe_ move to the cma
> > sysfs/debugfs (not 100% sure about this part, but probably worth exploring).
>
> We should be able to use a sysfs parameter too. Will try that out.

Thanks. The reason I think it might be preferable is that new sysctls are hated
by everyone and this use case looks a very niche.

> But could you elaborate on what is more generic way?

I mean in the proposed patch it's only possible to shift the ratio towards cma:
a larger sysctl value will make allocations from the cma area happening earlier.
The value 1 will turn it off completely.

Probably better to define the new knob in % or 1/1000's with the default value
50% or 500. 0 will mean never use cma from this path, 999 - always.
Something along these lines.

Thanks!