Thread (27 messages) 27 messages, 7 authors, 2024-11-01

Re: [RFC PATCH 0/3] Cgroup-based THP control

From: Michal Hocko <mhocko@suse.com>
Date: 2024-10-30 08:38:29
Also in: linux-mm, lkml

On Wed 30-10-24 16:33:08, gutierrez.asier@huawei-partners.com wrote:
From: Asier Gutierrez <redacted>

Currently THP modes are set globally. It can be an overkill if only some
specific app/set of apps need to get benefits from THP usage. Moreover, various
apps might need different THP settings. Here we propose a cgroup-based THP
control mechanism.

THP interface is added to memory cgroup subsystem. Existing global THP control
semantics is supported for backward compatibility. When THP modes are set
globally all the changes are propagated to memory cgroups. However, when a
particular cgroup changes its THP policy, the global THP policy in sysfs remains
the same.
Do you have any specific examples where this would be benefitial?
New memcg files are exposed: memory.thp_enabled and memory.thp_defrag, which
have completely the same format as global THP enabled/defrag.

Child cgroups inherit THP settings from parent cgroup upon creation. Particular
cgroup mode changes aren't propagated to child cgroups.
So this breaks hierarchical property, doesn't it? In other words if a
parent cgroup would like to enforce a certain policy to all descendants
then this is not really possible. 
-- 
Michal Hocko
SUSE Labs
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help