Skip to contentSkip to conversation

mm-memcg-deprecate-the-non-hierarchical-mode.patch removed from -mm tree

merged [email protected] 1 participant 1 message Dec 16, 2020

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm: memcg: deprecate the non-hierarchical mode
has been removed from the -mm tree. Its filename was
mm-memcg-deprecate-the-non-hierarchical-mode.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Roman Gushchin <[email protected]>
Subject: mm: memcg: deprecate the non-hierarchical mode

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

---

 include/linux/memcontrol.h |    7 --
 kernel/cgroup/cgroup.c     |    5 -
 mm/memcontrol.c            |   90 +++++------------------------------
 3 files changed, 13 insertions(+), 89 deletions(-)
include/linux/memcontrol.h renamed from include/linux/memcontrol.h~mm-memcg-deprecate-the-non-hierarchical-mode +0 -7
@@ -235,11 +235,6 @@ struct mem_cgroup {
 	struct vmpressure vmpressure;
 
 	/*
-	 * Should the accounting and control be hierarchical, per subtree?
-	 */
-	bool use_hierarchy;
-
-	/*
 	 * Should the OOM killer kill all belonging tasks, had it kill one?
 	 */
 	bool oom_group;
@@ -588,8 +583,6 @@ static inline bool mem_cgroup_is_descend
 {
 	if (root == memcg)
 		return true;
-	if (!root->use_hierarchy)
-		return false;
 	return cgroup_is_descendant(memcg->css.cgroup, root->css.cgroup);
 }
 
kernel/cgroup/cgroup.c renamed from kernel/cgroup/cgroup.c~mm-memcg-deprecate-the-non-hierarchical-mode +0 -5
@@ -281,9 +281,6 @@ bool cgroup_ssid_enabled(int ssid)
  * - cpuset: a task can be moved into an empty cpuset, and again it takes
  *   masks of ancestors.
  *
- * - memcg: use_hierarchy is on by default and the cgroup file for the flag
- *   is not created.
- *
  * - blkcg: blk-throttle becomes properly hierarchical.
  *
  * - debug: disallowed on the default hierarchy.
@@ -5156,8 +5153,6 @@ static struct cgroup_subsys_state *css_c
 	    cgroup_parent(parent)) {
 		pr_warn("%s (%d) created nested cgroup for controller \"%s\" which has incomplete hierarchy support. Nested cgroups may change behavior in the future.\n",
 			current->comm, current->pid, ss->name);
-		if (!strcmp(ss->name, "memory"))
-			pr_warn("\"memory\" requires setting use_hierarchy to 1 on the root\n");
 		ss->warned_broken_hierarchy = true;
 	}
 
mm/memcontrol.c renamed from mm/memcontrol.c~mm-memcg-deprecate-the-non-hierarchical-mode +13 -77

156 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are

mm-vmstat-fix-proc-sys-vm-stat_refresh-generating-false-warnings.patch mm-vmstat-fix-proc-sys-vm-stat_refresh-generating-false-warnings-fix.patch mm-slub-call-account_slab_page-after-slab-page-initialization.patch mm-memcg-slab-pre-allocate-obj_cgroups-for-slab-caches-with-slab_account.patch mm-memcg-slab-pre-allocate-obj_cgroups-for-slab-caches-with-slab_account-v2.patch