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

Michal Hocko
2020-03-24T13:17:36Z

On Tue 24-03-20 20:30:32, teawater wrote:
>
>
> > 2020年3月24日 19:00，Michal Hocko <mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> 写道：
> >
> > On Tue 24-03-20 18:31:56, Hui Zhu wrote:
> >> /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.
> >
> > Could you specify that sometime by a real usecase in the memcg context
> > please?
>
>
> Thanks for your review.
>
> We use thp+balloon to supply more memory flexibility for vm.
> https://lore.kernel.org/linux-mm/1584893097-12317-1-git-send-email-teawater-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org/
> This is another thread that I am working around thp+balloon.
>
> Other applications are already deployed on these machines. The
> transparent_hugepage/enabled is set to never because they used to have
> a lot of THP related performance issues. And some of them may call
> madvise thp with itself.

If they call madvise then they clearly indicate they prefer THP
regardless the cost. So I really fail to see what memcg specific tuning
brings in.

Could you be more specific about the usecase that cannot work with the
existing THP tuning?
--
Michal Hocko
SUSE Labs