Re: [PATCH] mm, memcg: Add memory.transparent_hugepage_disabled

Chris Down
2020-03-24T13:23:50Z

Hui Zhu writes:
>/sys/kernel/mm/transparent_hugepage/enabled is the only interface to
>control if the application can use THP in system level.
>Sometime, we would not want an application use THP even if
>transparent_hugepage/enabled is set to "always" or "madvise" because
>thp may need more cpu and memory resources in some cases.
>
>This commit add a new interface memory.transparent_hugepage_disabled
>in memcg.
>When it set to 1, the application inside the cgroup cannot use THP
>except dax.

I'm against this patch even in the abstract -- this adds an extremely niche use
case to a general interface, and there are plenty of ways to already indicate
THP preference.

Perhaps there is some new interface desirable for your use case, but adding a
new global file to memcg certainly isn't it.