• Roman Gushchin's avatar
    mm: memcg: deprecate the non-hierarchical mode · bef8620c
    Roman Gushchin authored
    Patch series "mm: memcg: deprecate cgroup v1 non-hierarchical mode", v1.
    
    The non-hierarchical cgroup v1 mode is a legacy of early days
    of the memory controller and doesn't bring any value today.
    However, it complicates the code and creates many edge cases
    all over the memory controller code.
    
    It's a good time to deprecate it completely. This patchset removes
    the internal logic, adjusts the user interface and updates
    the documentation. The alt patch removes some bits of the cgroup
    core code, which become obsolete.
    
    Michal Hocko said:
      "All that we know today is that we have a warning in place to complain
       loudly when somebody relies on use_hierarchy=0 with a deeper
       hierarchy. For all those years we have seen _zero_ reports that would
       describe a sensible usecase.
    
       Moreover we (SUSE) have backported this warning into old distribution
       kernels (since 3.0 based kernels) to extend the coverage and didn't
       hear even for users who adopt new kernels only very slowly. The only
       report we have seen so far was a LTP test suite which doesn't really
       reflect any real life usecase"
    
    This patch (of 3):
    
    The non-hierarchical cgroup v1 mode is a legacy of early days of the
    memory controller and doesn't bring any value today.  However, it
    complicates the code and creates many edge cases all over the memory
    controller code.
    
    It's a good time to deprecate it completely.
    
    Functionally this patch enabled is by default for all cgroups and forbids
    switching it off.  Nothing changes if cgroup v2 is used: hierarchical mode
    was enforced from scratch.
    
    To protect the ABI memory.use_hierarchy interface is preserved with a
    limited functionality: reading always returns "1", writing of "1" passes
    silently, writing of any other value fails with -EINVAL and a warning to
    dmesg (on the first occasion).
    
    Link: https://lkml.kernel.org/r/20201110220800.929549-1-guro@fb.com
    Link: https://lkml.kernel.org/r/20201110220800.929549-2-guro@fb.comSigned-off-by: default avatarRoman Gushchin <guro@fb.com>
    Acked-by: default avatarMichal Hocko <mhocko@suse.com>
    Reviewed-by: default avatarShakeel Butt <shakeelb@google.com>
    Acked-by: default avatarDavid Rientjes <rientjes@google.com>
    Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
    Cc: Tejun Heo <tj@kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    bef8620c
memcontrol.c 189 KB