Thread (17 messages) 17 messages, 4 authors, 2022-08-25

Re: [RFC PATCH] memcg: use root_mem_cgroup when css is inherited

From: Michal Hocko <mhocko@suse.com>
Date: 2022-08-25 06:41:01
Also in: cgroups, lkml

On Thu 25-08-22 08:43:52, Zhaoyang Huang wrote:
On Wed, Aug 24, 2022 at 6:27 PM Michal Hocko [off-list ref] wrote:
quoted
On Wed 24-08-22 17:34:42, Zhaoyang Huang wrote:
[...]
quoted
quoted
IMHO, charging the pages which out of explicitly memory
enabled group to root could solve all of the above constraints with no
harm.
This would break the hierarchical property of the controller. So a
strong no no. Consider the following example

       root
        |
        A
controllers="memory"
memory.max = 1G
subtree_control=""
|      |      |
A1     A2     A3

althought A1,2,3 do not have their memory controller enabled explicitly
they are still constrained by the A memcg limit. If you just charge to
the root because it doesn't have memory controller enabled explicitly
then you just evade that constrain. I hope you understand why that is a
problem.
IMO, A1-A3 should be explicitly enabled via echo "+memory" >
A/subtree_control since memory.max has been set.
You seem to be missing the point I've triedy to make here. It is not
about how the respective subtree should or shouldn't be configured. It
is about the hierarchical behavior. Configuration at a higher level should be
enforced under subtree no matter how that subtree decides to
enabled/disable controllers. Such subtree might have beeb delegated
and configured differently yet the constrain should be still applied.
See the point?

What you seem to be proposing is similar to cgroup v1 use_hierarchy
configuration. It has been decided that this is undesirable very early
in the cgroup v2 development because it make delegation impossible
(among other reasons).

-- 
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