On Wed 30-10-24 15:51:00, Gutierrez Asier wrote: > > > On 10/30/2024 11:38 AM, Michal Hocko wrote: > > On Wed 30-10-24 16:33:08, gutierrez.asier@xxxxxxxxxxxxxxxxxxx wrote: > >> From: Asier Gutierrez <gutierrez.asier@xxxxxxxxxxxxxxxxxxx> > >> > >> 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? > > Now we're mostly focused on database scenarios (MySQL, Redis). That seems to be more process than workload oriented. Why the existing per-process tuning doesn't work? [...] > >> 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. > > The first idea was to have some flexibility when changing THP policies. > > I will submit a new patch set which will enforce the cgroup hierarchy and change all > the children recursively. What is the expected semantics then? -- Michal Hocko SUSE Labs