The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2 00/11] cgroup v1 deprecation messages
@ 2025-03-11 12:36 Michal Koutný
  2025-03-11 12:36 ` [PATCH v2 01/11] cgroup/cpuset-v1: Add deprecation messages to sched_load_balance and memory_pressure_enabled Michal Koutný
                   ` (12 more replies)
  0 siblings, 13 replies; 20+ messages in thread
From: Michal Koutný @ 2025-03-11 12:36 UTC (permalink / raw)
  To: cgroups, linux-block, linux-kernel, linux-doc, linux-mm
  Cc: Michal Koutný, Josef Bacik, Waiman Long, Jonathan Corbet,
	Andrew Morton, Shakeel Butt, Roman Gushchin, Johannes Weiner,
	Tejun Heo, Muchun Song, Michal Hocko, Jens Axboe

Memory controller had begun to print warning messages when using some
attributes that do no have a counterpart in its cgroup v2
implementation. This is informative to users who run (unwittingly) on v1
or to distros that run v1 (they can learn about such users or prepare
for disabling v1 configs).

I consider the deprecated files in three categories:
  - RE) replacement exists,
  - DN) dropped as non-ideal concept (e.g. non-hierarchical resources),
  - NE) not evaluated (yet).

For RE, I added the replacement into the warning message, DN have only a
plain deprecation message and I marked the commits with NE as RFC.
Also I'd be happy if you would point out some forgotten knobs that'd
deserve similar warnings.

The level of messages is info to avoid too much noise (may be increased
in future when there are fewer users). Some knobs from DN have warn
level.

The net_cls and net_prio controllers that only exist on v1 hierarchies
have no straightforward action for users (replacement would rely on net
NS or eBPF), so messages for their usage are omitted, although it'd be
good to eventually retire that code in favor of aforementioned.

At the end are some cleanup patches I encountered en route.

Changes from v1 (https://lore.kernel.org/r/20250304153801.597907-1-mkoutny@suse.com/)
- cpuset load_balance/pressure warn wording (Waiman)
- comment typo (Waiman)
- collect Acks
- drop bouncing Cc: and respective RFC (self)
- change level warn -> info, except for spread slab (Tejun)
- add memory.swappiness (self)
- add legacy freezer message (self)
- update cover wrt net* controllers (self)

Michal Koutný (11):
  cgroup/cpuset-v1: Add deprecation messages to sched_load_balance and
    memory_pressure_enabled
  cgroup/cpuset-v1: Add deprecation messages to memory_spread_page and
    memory_spread_slab
  cgroup/blkio: Add deprecation messages to reset_stats
  cgroup: Print message when /proc/cgroups is read on v2-only system
  cgroup/cpuset-v1: Add deprecation messages to mem_exclusive and
    mem_hardwall
  cgroup/cpuset-v1: Add deprecation messages to memory_migrate
  RFC cgroup/cpuset-v1: Add deprecation messages to
    sched_relax_domain_level
  mm: Add transformation message for per-memcg swappiness
  cgroup: Add deprecation message to legacy freezer controller
  cgroup: Update file naming comment
  blk-cgroup: Simplify policy files registration

 .../cgroup-v1/freezer-subsystem.rst           |  4 ++++
 .../admin-guide/cgroup-v1/memory.rst          |  1 +
 block/blk-cgroup.c                            |  8 +++++--
 block/blk-ioprio.c                            | 23 ++++++-------------
 include/linux/cgroup-defs.h                   |  5 ++--
 include/linux/cgroup.h                        |  1 +
 kernel/cgroup/cgroup-internal.h               |  1 +
 kernel/cgroup/cgroup-v1.c                     |  7 ++++++
 kernel/cgroup/cgroup.c                        |  4 ++--
 kernel/cgroup/cpuset-v1.c                     |  8 +++++++
 kernel/cgroup/legacy_freezer.c                |  6 +++--
 mm/memcontrol-v1.c                            |  6 +++--
 12 files changed, 47 insertions(+), 27 deletions(-)


base-commit: 80e54e84911a923c40d7bee33a34c1b4be148d7a
-- 
2.48.1


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH v2 01/11] cgroup/cpuset-v1: Add deprecation messages to sched_load_balance and memory_pressure_enabled
  2025-03-11 12:36 [PATCH v2 00/11] cgroup v1 deprecation messages Michal Koutný
@ 2025-03-11 12:36 ` Michal Koutný
  2025-03-11 14:02   ` Waiman Long
  2025-03-11 12:36 ` [PATCH v2 02/11] cgroup/cpuset-v1: Add deprecation messages to memory_spread_page and memory_spread_slab Michal Koutný
                   ` (11 subsequent siblings)
  12 siblings, 1 reply; 20+ messages in thread
From: Michal Koutný @ 2025-03-11 12:36 UTC (permalink / raw)
  To: cgroups, linux-kernel
  Cc: Michal Koutný, Waiman Long, Tejun Heo, Johannes Weiner

These two v1 feature have analogues in cgroup v2.

Signed-off-by: Michal Koutný <mkoutny@suse.com>
---
 kernel/cgroup/cpuset-v1.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/cgroup/cpuset-v1.c b/kernel/cgroup/cpuset-v1.c
index 25c1d7b77e2f2..9d47b20c03c4b 100644
--- a/kernel/cgroup/cpuset-v1.c
+++ b/kernel/cgroup/cpuset-v1.c
@@ -430,12 +430,14 @@ static int cpuset_write_u64(struct cgroup_subsys_state *css, struct cftype *cft,
 		retval = cpuset_update_flag(CS_MEM_HARDWALL, cs, val);
 		break;
 	case FILE_SCHED_LOAD_BALANCE:
+		pr_info_once("cpuset.%s is deprecated, use cpuset.cpus.partition instead\n", cft->name);
 		retval = cpuset_update_flag(CS_SCHED_LOAD_BALANCE, cs, val);
 		break;
 	case FILE_MEMORY_MIGRATE:
 		retval = cpuset_update_flag(CS_MEMORY_MIGRATE, cs, val);
 		break;
 	case FILE_MEMORY_PRESSURE_ENABLED:
+		pr_info_once("cpuset.%s is deprecated, use memory.pressure with CONFIG_PSI instead\n", cft->name);
 		cpuset_memory_pressure_enabled = !!val;
 		break;
 	case FILE_SPREAD_PAGE:
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 02/11] cgroup/cpuset-v1: Add deprecation messages to memory_spread_page and memory_spread_slab
  2025-03-11 12:36 [PATCH v2 00/11] cgroup v1 deprecation messages Michal Koutný
  2025-03-11 12:36 ` [PATCH v2 01/11] cgroup/cpuset-v1: Add deprecation messages to sched_load_balance and memory_pressure_enabled Michal Koutný
@ 2025-03-11 12:36 ` Michal Koutný
  2025-03-11 15:07   ` Waiman Long
  2025-03-11 12:36 ` [PATCH v2 03/11] cgroup/blkio: Add deprecation messages to reset_stats Michal Koutný
                   ` (10 subsequent siblings)
  12 siblings, 1 reply; 20+ messages in thread
From: Michal Koutný @ 2025-03-11 12:36 UTC (permalink / raw)
  To: cgroups, linux-kernel
  Cc: Michal Koutný, Waiman Long, Tejun Heo, Johannes Weiner

There is MPOL_INTERLEAVE for user explicit allocations.
Deprecate spreading of allocations that users carry out unwittingly.
Use straight warning level for slab spreading since such a knob is
unnecessarily intertwined with slab allocator.

Signed-off-by: Michal Koutný <mkoutny@suse.com>
---
 kernel/cgroup/cpuset-v1.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/cgroup/cpuset-v1.c b/kernel/cgroup/cpuset-v1.c
index 9d47b20c03c4b..fea8a0cb7ae1d 100644
--- a/kernel/cgroup/cpuset-v1.c
+++ b/kernel/cgroup/cpuset-v1.c
@@ -441,9 +441,11 @@ static int cpuset_write_u64(struct cgroup_subsys_state *css, struct cftype *cft,
 		cpuset_memory_pressure_enabled = !!val;
 		break;
 	case FILE_SPREAD_PAGE:
+		pr_info_once("cpuset.%s is deprecated\n", cft->name);
 		retval = cpuset_update_flag(CS_SPREAD_PAGE, cs, val);
 		break;
 	case FILE_SPREAD_SLAB:
+		pr_warn_once("cpuset.%s is deprecated\n", cft->name);
 		retval = cpuset_update_flag(CS_SPREAD_SLAB, cs, val);
 		break;
 	default:
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 03/11] cgroup/blkio: Add deprecation messages to reset_stats
  2025-03-11 12:36 [PATCH v2 00/11] cgroup v1 deprecation messages Michal Koutný
  2025-03-11 12:36 ` [PATCH v2 01/11] cgroup/cpuset-v1: Add deprecation messages to sched_load_balance and memory_pressure_enabled Michal Koutný
  2025-03-11 12:36 ` [PATCH v2 02/11] cgroup/cpuset-v1: Add deprecation messages to memory_spread_page and memory_spread_slab Michal Koutný
@ 2025-03-11 12:36 ` Michal Koutný
  2025-03-11 12:36 ` [PATCH v2 04/11] cgroup: Print message when /proc/cgroups is read on v2-only system Michal Koutný
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Michal Koutný @ 2025-03-11 12:36 UTC (permalink / raw)
  To: cgroups, linux-block, linux-kernel
  Cc: Michal Koutný, Tejun Heo, Josef Bacik, Jens Axboe

It is difficult to sync with stat updaters, stats are (should be)
monotonic so users can calculate differences from a reference.

Signed-off-by: Michal Koutný <mkoutny@suse.com>
---
 block/blk-cgroup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 9ed93d91d754a..1464c968eeb0c 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -659,6 +659,7 @@ static int blkcg_reset_stats(struct cgroup_subsys_state *css,
 	struct blkcg_gq *blkg;
 	int i;
 
+	pr_info_once("blkio.%s is deprecated\n", cftype->name);
 	mutex_lock(&blkcg_pol_mutex);
 	spin_lock_irq(&blkcg->lock);
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 04/11] cgroup: Print message when /proc/cgroups is read on v2-only system
  2025-03-11 12:36 [PATCH v2 00/11] cgroup v1 deprecation messages Michal Koutný
                   ` (2 preceding siblings ...)
  2025-03-11 12:36 ` [PATCH v2 03/11] cgroup/blkio: Add deprecation messages to reset_stats Michal Koutný
@ 2025-03-11 12:36 ` Michal Koutný
  2025-03-11 12:36 ` [PATCH v2 05/11] cgroup/cpuset-v1: Add deprecation messages to mem_exclusive and mem_hardwall Michal Koutný
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Michal Koutný @ 2025-03-11 12:36 UTC (permalink / raw)
  To: cgroups, linux-kernel
  Cc: Michal Koutný, Waiman Long, Tejun Heo, Johannes Weiner

As a followup to commits 6c2920926b10e ("cgroup: replace
unified-hierarchy.txt with a proper cgroup v2 documentation") and
ab03125268679 ("cgroup: Show # of subsystem CSSes in cgroup.stat"),
add a runtime message to users who read status of controllers in
/proc/cgroups on v2-only system. The detection is based on a)
no controllers are attached to v1, b) default hierarchy is mounted (the
latter is for setups that never mount v2 but read /proc/cgroups upon
boot when controllers default to v2, so that this code may be backported
to older kernels).

Signed-off-by: Michal Koutný <mkoutny@suse.com>
Acked-by: Waiman Long <longman@redhat.com>
---
 kernel/cgroup/cgroup-internal.h | 1 +
 kernel/cgroup/cgroup-v1.c       | 7 +++++++
 kernel/cgroup/cgroup.c          | 2 +-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/kernel/cgroup/cgroup-internal.h b/kernel/cgroup/cgroup-internal.h
index c964dd7ff967a..95ab39e1ec8f0 100644
--- a/kernel/cgroup/cgroup-internal.h
+++ b/kernel/cgroup/cgroup-internal.h
@@ -168,6 +168,7 @@ struct cgroup_mgctx {
 
 extern struct cgroup_subsys *cgroup_subsys[];
 extern struct list_head cgroup_roots;
+extern bool cgrp_dfl_visible;
 
 /* iterate across the hierarchies */
 #define for_each_root(root)						\
diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c
index e28d5f0d20ed0..11ea8d24ac727 100644
--- a/kernel/cgroup/cgroup-v1.c
+++ b/kernel/cgroup/cgroup-v1.c
@@ -673,6 +673,7 @@ struct cftype cgroup1_base_files[] = {
 int proc_cgroupstats_show(struct seq_file *m, void *v)
 {
 	struct cgroup_subsys *ss;
+	bool cgrp_v1_visible = false;
 	int i;
 
 	seq_puts(m, "#subsys_name\thierarchy\tnum_cgroups\tenabled\n");
@@ -684,12 +685,18 @@ int proc_cgroupstats_show(struct seq_file *m, void *v)
 	for_each_subsys(ss, i) {
 		if (cgroup1_subsys_absent(ss))
 			continue;
+		cgrp_v1_visible |= ss->root != &cgrp_dfl_root;
+
 		seq_printf(m, "%s\t%d\t%d\t%d\n",
 			   ss->legacy_name, ss->root->hierarchy_id,
 			   atomic_read(&ss->root->nr_cgrps),
 			   cgroup_ssid_enabled(i));
 	}
 
+	if (cgrp_dfl_visible && !cgrp_v1_visible)
+		pr_info_once("/proc/cgroups lists only v1 controllers, use cgroup.controllers of root cgroup for v2 info\n");
+
+
 	return 0;
 }
 
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index afc665b7b1fe5..3a5af0fc544a6 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -171,7 +171,7 @@ EXPORT_SYMBOL_GPL(cgrp_dfl_root);
  * The default hierarchy always exists but is hidden until mounted for the
  * first time.  This is for backward compatibility.
  */
-static bool cgrp_dfl_visible;
+bool cgrp_dfl_visible;
 
 /* some controllers are not supported in the default hierarchy */
 static u16 cgrp_dfl_inhibit_ss_mask;
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 05/11] cgroup/cpuset-v1: Add deprecation messages to mem_exclusive and mem_hardwall
  2025-03-11 12:36 [PATCH v2 00/11] cgroup v1 deprecation messages Michal Koutný
                   ` (3 preceding siblings ...)
  2025-03-11 12:36 ` [PATCH v2 04/11] cgroup: Print message when /proc/cgroups is read on v2-only system Michal Koutný
@ 2025-03-11 12:36 ` Michal Koutný
  2025-03-11 15:08   ` Waiman Long
  2025-03-11 12:36 ` [PATCH v2 06/11] cgroup/cpuset-v1: Add deprecation messages to memory_migrate Michal Koutný
                   ` (7 subsequent siblings)
  12 siblings, 1 reply; 20+ messages in thread
From: Michal Koutný @ 2025-03-11 12:36 UTC (permalink / raw)
  To: cgroups, linux-kernel
  Cc: Michal Koutný, Waiman Long, Tejun Heo, Johannes Weiner

The concept of exclusive memory affinity may require complex approaches
like with cpuset v2 cpu partitions. There is so far no implementation in
cpuset v2.
Specific kernel memory affinity may cause unintended (global)
bottlenecks like kmem limits.

Signed-off-by: Michal Koutný <mkoutny@suse.com>
---
 kernel/cgroup/cpuset-v1.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/cgroup/cpuset-v1.c b/kernel/cgroup/cpuset-v1.c
index fea8a0cb7ae1d..b243bdd952d78 100644
--- a/kernel/cgroup/cpuset-v1.c
+++ b/kernel/cgroup/cpuset-v1.c
@@ -424,9 +424,11 @@ static int cpuset_write_u64(struct cgroup_subsys_state *css, struct cftype *cft,
 		retval = cpuset_update_flag(CS_CPU_EXCLUSIVE, cs, val);
 		break;
 	case FILE_MEM_EXCLUSIVE:
+		pr_info_once("cpuset.%s is deprecated\n", cft->name);
 		retval = cpuset_update_flag(CS_MEM_EXCLUSIVE, cs, val);
 		break;
 	case FILE_MEM_HARDWALL:
+		pr_info_once("cpuset.%s is deprecated\n", cft->name);
 		retval = cpuset_update_flag(CS_MEM_HARDWALL, cs, val);
 		break;
 	case FILE_SCHED_LOAD_BALANCE:
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 06/11] cgroup/cpuset-v1: Add deprecation messages to memory_migrate
  2025-03-11 12:36 [PATCH v2 00/11] cgroup v1 deprecation messages Michal Koutný
                   ` (4 preceding siblings ...)
  2025-03-11 12:36 ` [PATCH v2 05/11] cgroup/cpuset-v1: Add deprecation messages to mem_exclusive and mem_hardwall Michal Koutný
@ 2025-03-11 12:36 ` Michal Koutný
  2025-03-11 15:09   ` Waiman Long
  2025-03-11 12:36 ` [PATCH v2 07/11] RFC cgroup/cpuset-v1: Add deprecation messages to sched_relax_domain_level Michal Koutný
                   ` (6 subsequent siblings)
  12 siblings, 1 reply; 20+ messages in thread
From: Michal Koutný @ 2025-03-11 12:36 UTC (permalink / raw)
  To: cgroups, linux-kernel
  Cc: Michal Koutný, Waiman Long, Tejun Heo, Johannes Weiner

Memory migration (between cgroups) was given up in v2 due to performance
reasons of its implementation. Migration between NUMA nodes within one
memcg may still make sense to modify affinity at runtime though.

Signed-off-by: Michal Koutný <mkoutny@suse.com>
---
 kernel/cgroup/cpuset-v1.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/cgroup/cpuset-v1.c b/kernel/cgroup/cpuset-v1.c
index b243bdd952d78..7c37fabcf0ba8 100644
--- a/kernel/cgroup/cpuset-v1.c
+++ b/kernel/cgroup/cpuset-v1.c
@@ -436,6 +436,7 @@ static int cpuset_write_u64(struct cgroup_subsys_state *css, struct cftype *cft,
 		retval = cpuset_update_flag(CS_SCHED_LOAD_BALANCE, cs, val);
 		break;
 	case FILE_MEMORY_MIGRATE:
+		pr_info_once("cpuset.%s is deprecated\n", cft->name);
 		retval = cpuset_update_flag(CS_MEMORY_MIGRATE, cs, val);
 		break;
 	case FILE_MEMORY_PRESSURE_ENABLED:
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 07/11] RFC cgroup/cpuset-v1: Add deprecation messages to sched_relax_domain_level
  2025-03-11 12:36 [PATCH v2 00/11] cgroup v1 deprecation messages Michal Koutný
                   ` (5 preceding siblings ...)
  2025-03-11 12:36 ` [PATCH v2 06/11] cgroup/cpuset-v1: Add deprecation messages to memory_migrate Michal Koutný
@ 2025-03-11 12:36 ` Michal Koutný
  2025-03-11 15:10   ` Waiman Long
  2025-03-11 15:10   ` Waiman Long
  2025-03-11 12:36 ` [PATCH v2 08/11] mm: Add transformation message for per-memcg swappiness Michal Koutný
                   ` (5 subsequent siblings)
  12 siblings, 2 replies; 20+ messages in thread
From: Michal Koutný @ 2025-03-11 12:36 UTC (permalink / raw)
  To: cgroups, linux-kernel
  Cc: Michal Koutný, Hidetoshi Seto, Waiman Long, Tejun Heo,
	Johannes Weiner

This is not a properly hierarchical resource, it might be better
implemented based on a sched_attr.

Cc: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Michal Koutný <mkoutny@suse.com>
---
 kernel/cgroup/cpuset-v1.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/cgroup/cpuset-v1.c b/kernel/cgroup/cpuset-v1.c
index 7c37fabcf0ba8..5516df307d520 100644
--- a/kernel/cgroup/cpuset-v1.c
+++ b/kernel/cgroup/cpuset-v1.c
@@ -175,6 +175,7 @@ static int cpuset_write_s64(struct cgroup_subsys_state *css, struct cftype *cft,
 
 	switch (type) {
 	case FILE_SCHED_RELAX_DOMAIN_LEVEL:
+		pr_info_once("cpuset.%s is deprecated\n", cft->name);
 		retval = update_relax_domain_level(cs, val);
 		break;
 	default:
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 08/11] mm: Add transformation message for per-memcg swappiness
  2025-03-11 12:36 [PATCH v2 00/11] cgroup v1 deprecation messages Michal Koutný
                   ` (6 preceding siblings ...)
  2025-03-11 12:36 ` [PATCH v2 07/11] RFC cgroup/cpuset-v1: Add deprecation messages to sched_relax_domain_level Michal Koutný
@ 2025-03-11 12:36 ` Michal Koutný
  2025-03-11 12:36 ` [PATCH v2 09/11] cgroup: Add deprecation message to legacy freezer controller Michal Koutný
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Michal Koutný @ 2025-03-11 12:36 UTC (permalink / raw)
  To: cgroups, linux-doc, linux-kernel, linux-mm
  Cc: Michal Koutný, Tejun Heo, Johannes Weiner, Jonathan Corbet,
	Michal Hocko, Roman Gushchin, Shakeel Butt, Muchun Song,
	Andrew Morton

The concept of per-memcg swappiness has never landed well in memcg for
cgroup v2. Add a message to users who use it on v1 hierarchy.
Decreased swappiness transforms to memory.swap.max=0 whereas
increased swappiness transforms into active memory.reclaim operation.

Link: https://lore.kernel.org/r/1577252208-32419-1-git-send-email-teawater@gmail.com/
Signed-off-by: Michal Koutný <mkoutny@suse.com>
---
 Documentation/admin-guide/cgroup-v1/memory.rst | 1 +
 mm/memcontrol-v1.c                             | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Documentation/admin-guide/cgroup-v1/memory.rst b/Documentation/admin-guide/cgroup-v1/memory.rst
index 286d16fc22ebb..02b8206a35941 100644
--- a/Documentation/admin-guide/cgroup-v1/memory.rst
+++ b/Documentation/admin-guide/cgroup-v1/memory.rst
@@ -90,6 +90,7 @@ Brief summary of control files.
                                      used.
  memory.swappiness		     set/show swappiness parameter of vmscan
 				     (See sysctl's vm.swappiness)
+				     Per memcg knob does not exist in cgroup v2.
  memory.move_charge_at_immigrate     This knob is deprecated.
  memory.oom_control		     set/show oom controls.
                                      This knob is deprecated and shouldn't be
diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c
index 2be6b9112808c..29ca6489b4ff7 100644
--- a/mm/memcontrol-v1.c
+++ b/mm/memcontrol-v1.c
@@ -1855,9 +1855,11 @@ static int mem_cgroup_swappiness_write(struct cgroup_subsys_state *css,
 	if (val > MAX_SWAPPINESS)
 		return -EINVAL;
 
-	if (!mem_cgroup_is_root(memcg))
+	if (!mem_cgroup_is_root(memcg)) {
+		pr_info_once("Per memcg swappiness does not exist in cgroup v2. "
+			     "See memory.reclaim or memory.swap.max there\n ")
 		WRITE_ONCE(memcg->swappiness, val);
-	else
+	} else
 		WRITE_ONCE(vm_swappiness, val);
 
 	return 0;
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 09/11] cgroup: Add deprecation message to legacy freezer controller
  2025-03-11 12:36 [PATCH v2 00/11] cgroup v1 deprecation messages Michal Koutný
                   ` (7 preceding siblings ...)
  2025-03-11 12:36 ` [PATCH v2 08/11] mm: Add transformation message for per-memcg swappiness Michal Koutný
@ 2025-03-11 12:36 ` Michal Koutný
  2025-03-11 12:36 ` [PATCH v2 10/11] cgroup: Update file naming comment Michal Koutný
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Michal Koutný @ 2025-03-11 12:36 UTC (permalink / raw)
  To: cgroups, linux-doc, linux-kernel
  Cc: Michal Koutný, Tejun Heo, Johannes Weiner, Jonathan Corbet

As explained in the commit 76f969e8948d8 ("cgroup: cgroup v2 freezer"),
the original freezer is imperfect, some users may unwittingly rely on it
when there exists the alternative of v2. Print a message when it happens
and explain that in the docs.

Signed-off-by: Michal Koutný <mkoutny@suse.com>
---
 Documentation/admin-guide/cgroup-v1/freezer-subsystem.rst | 4 ++++
 kernel/cgroup/legacy_freezer.c                            | 6 ++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Documentation/admin-guide/cgroup-v1/freezer-subsystem.rst b/Documentation/admin-guide/cgroup-v1/freezer-subsystem.rst
index 582d3427de3f8..a964aff373b19 100644
--- a/Documentation/admin-guide/cgroup-v1/freezer-subsystem.rst
+++ b/Documentation/admin-guide/cgroup-v1/freezer-subsystem.rst
@@ -125,3 +125,7 @@ to unfreeze all tasks in the container::
 
 This is the basic mechanism which should do the right thing for user space task
 in a simple scenario.
+
+This freezer implementation is affected by shortcomings (see commit
+76f969e8948d8 ("cgroup: cgroup v2 freezer")) and cgroup v2 freezer is
+recommended.
diff --git a/kernel/cgroup/legacy_freezer.c b/kernel/cgroup/legacy_freezer.c
index 074653f964c1d..039d1eb2f215b 100644
--- a/kernel/cgroup/legacy_freezer.c
+++ b/kernel/cgroup/legacy_freezer.c
@@ -430,9 +430,11 @@ static ssize_t freezer_write(struct kernfs_open_file *of,
 
 	if (strcmp(buf, freezer_state_strs(0)) == 0)
 		freeze = false;
-	else if (strcmp(buf, freezer_state_strs(CGROUP_FROZEN)) == 0)
+	else if (strcmp(buf, freezer_state_strs(CGROUP_FROZEN)) == 0) {
+		pr_info_once("Freezing with imperfect legacy cgroup freezer. "
+			     "See cgroup.freeze of cgroup v2\n");
 		freeze = true;
-	else
+	} else
 		return -EINVAL;
 
 	freezer_change_state(css_freezer(of_css(of)), freeze);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 10/11] cgroup: Update file naming comment
  2025-03-11 12:36 [PATCH v2 00/11] cgroup v1 deprecation messages Michal Koutný
                   ` (8 preceding siblings ...)
  2025-03-11 12:36 ` [PATCH v2 09/11] cgroup: Add deprecation message to legacy freezer controller Michal Koutný
@ 2025-03-11 12:36 ` Michal Koutný
  2025-03-11 12:36 ` [PATCH v2 11/11] blk-cgroup: Simplify policy files registration Michal Koutný
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Michal Koutný @ 2025-03-11 12:36 UTC (permalink / raw)
  To: cgroups, linux-kernel; +Cc: Michal Koutný, Tejun Heo, Johannes Weiner

This changed long time ago in commit 8d7e6fb0a1db9 ("cgroup: update
cgroup name handling").

Signed-off-by: Michal Koutný <mkoutny@suse.com>
---
 include/linux/cgroup-defs.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h
index 17960a1e858db..485b651869d9b 100644
--- a/include/linux/cgroup-defs.h
+++ b/include/linux/cgroup-defs.h
@@ -619,9 +619,8 @@ struct cgroup_root {
  */
 struct cftype {
 	/*
-	 * By convention, the name should begin with the name of the
-	 * subsystem, followed by a period.  Zero length string indicates
-	 * end of cftype array.
+	 * Name of the subsystem is prepended in cgroup_file_name().
+	 * Zero length string indicates end of cftype array.
 	 */
 	char name[MAX_CFTYPE_NAME];
 	unsigned long private;
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 11/11] blk-cgroup: Simplify policy files registration
  2025-03-11 12:36 [PATCH v2 00/11] cgroup v1 deprecation messages Michal Koutný
                   ` (9 preceding siblings ...)
  2025-03-11 12:36 ` [PATCH v2 10/11] cgroup: Update file naming comment Michal Koutný
@ 2025-03-11 12:36 ` Michal Koutný
  2025-03-11 18:56 ` [PATCH v2 00/11] cgroup v1 deprecation messages Jens Axboe
  2025-03-11 19:23 ` Tejun Heo
  12 siblings, 0 replies; 20+ messages in thread
From: Michal Koutný @ 2025-03-11 12:36 UTC (permalink / raw)
  To: cgroups, linux-block, linux-kernel
  Cc: Michal Koutný, Tejun Heo, Josef Bacik, Jens Axboe,
	Johannes Weiner

Use one set of files when there is no difference between default and
legacy files, similar to regular subsys files registration. No
functional change.

Signed-off-by: Michal Koutný <mkoutny@suse.com>
---
 block/blk-cgroup.c     |  7 +++++--
 block/blk-ioprio.c     | 23 +++++++----------------
 include/linux/cgroup.h |  1 +
 kernel/cgroup/cgroup.c |  2 +-
 4 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 1464c968eeb0c..1994a11ff9034 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1771,12 +1771,15 @@ int blkcg_policy_register(struct blkcg_policy *pol)
 	mutex_unlock(&blkcg_pol_mutex);
 
 	/* everything is in place, add intf files for the new policy */
-	if (pol->dfl_cftypes)
+	if (pol->dfl_cftypes == pol->legacy_cftypes) {
+		WARN_ON(cgroup_add_cftypes(&io_cgrp_subsys,
+					   pol->dfl_cftypes));
+	} else {
 		WARN_ON(cgroup_add_dfl_cftypes(&io_cgrp_subsys,
 					       pol->dfl_cftypes));
-	if (pol->legacy_cftypes)
 		WARN_ON(cgroup_add_legacy_cftypes(&io_cgrp_subsys,
 						  pol->legacy_cftypes));
+	}
 	mutex_unlock(&blkcg_pol_register_mutex);
 	return 0;
 
diff --git a/block/blk-ioprio.c b/block/blk-ioprio.c
index 8fff7ccc0ac73..13659dc15c3ff 100644
--- a/block/blk-ioprio.c
+++ b/block/blk-ioprio.c
@@ -113,27 +113,18 @@ static void ioprio_free_cpd(struct blkcg_policy_data *cpd)
 	kfree(blkcg);
 }
 
-#define IOPRIO_ATTRS						\
-	{							\
-		.name		= "prio.class",			\
-		.seq_show	= ioprio_show_prio_policy,	\
-		.write		= ioprio_set_prio_policy,	\
-	},							\
-	{ } /* sentinel */
-
-/* cgroup v2 attributes */
 static struct cftype ioprio_files[] = {
-	IOPRIO_ATTRS
-};
-
-/* cgroup v1 attributes */
-static struct cftype ioprio_legacy_files[] = {
-	IOPRIO_ATTRS
+	{
+		.name		= "prio.class",
+		.seq_show	= ioprio_show_prio_policy,
+		.write		= ioprio_set_prio_policy,
+	},
+	{ } /* sentinel */
 };
 
 static struct blkcg_policy ioprio_policy = {
 	.dfl_cftypes	= ioprio_files,
-	.legacy_cftypes = ioprio_legacy_files,
+	.legacy_cftypes = ioprio_files,
 
 	.cpd_alloc_fn	= ioprio_alloc_cpd,
 	.cpd_free_fn	= ioprio_free_cpd,
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index f8ef47f8a634d..8e7415c64ed1d 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -113,6 +113,7 @@ int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from);
 
 int cgroup_add_dfl_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
 int cgroup_add_legacy_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
+int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
 int cgroup_rm_cftypes(struct cftype *cfts);
 void cgroup_file_notify(struct cgroup_file *cfile);
 void cgroup_file_show(struct cgroup_file *cfile, bool show);
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 3a5af0fc544a6..e93b0563a8964 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -4447,7 +4447,7 @@ int cgroup_rm_cftypes(struct cftype *cfts)
  * function currently returns 0 as long as @cfts registration is successful
  * even if some file creation attempts on existing cgroups fail.
  */
-static int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts)
+int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts)
 {
 	int ret;
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 01/11] cgroup/cpuset-v1: Add deprecation messages to sched_load_balance and memory_pressure_enabled
  2025-03-11 12:36 ` [PATCH v2 01/11] cgroup/cpuset-v1: Add deprecation messages to sched_load_balance and memory_pressure_enabled Michal Koutný
@ 2025-03-11 14:02   ` Waiman Long
  0 siblings, 0 replies; 20+ messages in thread
From: Waiman Long @ 2025-03-11 14:02 UTC (permalink / raw)
  To: Michal Koutný, cgroups, linux-kernel; +Cc: Tejun Heo, Johannes Weiner

On 3/11/25 8:36 AM, Michal Koutný wrote:
> These two v1 feature have analogues in cgroup v2.
>
> Signed-off-by: Michal Koutný <mkoutny@suse.com>
> ---
>   kernel/cgroup/cpuset-v1.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/kernel/cgroup/cpuset-v1.c b/kernel/cgroup/cpuset-v1.c
> index 25c1d7b77e2f2..9d47b20c03c4b 100644
> --- a/kernel/cgroup/cpuset-v1.c
> +++ b/kernel/cgroup/cpuset-v1.c
> @@ -430,12 +430,14 @@ static int cpuset_write_u64(struct cgroup_subsys_state *css, struct cftype *cft,
>   		retval = cpuset_update_flag(CS_MEM_HARDWALL, cs, val);
>   		break;
>   	case FILE_SCHED_LOAD_BALANCE:
> +		pr_info_once("cpuset.%s is deprecated, use cpuset.cpus.partition instead\n", cft->name);
>   		retval = cpuset_update_flag(CS_SCHED_LOAD_BALANCE, cs, val);
>   		break;
>   	case FILE_MEMORY_MIGRATE:
>   		retval = cpuset_update_flag(CS_MEMORY_MIGRATE, cs, val);
>   		break;
>   	case FILE_MEMORY_PRESSURE_ENABLED:
> +		pr_info_once("cpuset.%s is deprecated, use memory.pressure with CONFIG_PSI instead\n", cft->name);
>   		cpuset_memory_pressure_enabled = !!val;
>   		break;
>   	case FILE_SPREAD_PAGE:
Acked-by: Waiman Long <longman@redhat.com>


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 02/11] cgroup/cpuset-v1: Add deprecation messages to memory_spread_page and memory_spread_slab
  2025-03-11 12:36 ` [PATCH v2 02/11] cgroup/cpuset-v1: Add deprecation messages to memory_spread_page and memory_spread_slab Michal Koutný
@ 2025-03-11 15:07   ` Waiman Long
  0 siblings, 0 replies; 20+ messages in thread
From: Waiman Long @ 2025-03-11 15:07 UTC (permalink / raw)
  To: Michal Koutný, cgroups, linux-kernel; +Cc: Tejun Heo, Johannes Weiner


On 3/11/25 8:36 AM, Michal Koutný wrote:
> There is MPOL_INTERLEAVE for user explicit allocations.
> Deprecate spreading of allocations that users carry out unwittingly.
> Use straight warning level for slab spreading since such a knob is
> unnecessarily intertwined with slab allocator.
>
> Signed-off-by: Michal Koutný <mkoutny@suse.com>
> ---
>   kernel/cgroup/cpuset-v1.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/kernel/cgroup/cpuset-v1.c b/kernel/cgroup/cpuset-v1.c
> index 9d47b20c03c4b..fea8a0cb7ae1d 100644
> --- a/kernel/cgroup/cpuset-v1.c
> +++ b/kernel/cgroup/cpuset-v1.c
> @@ -441,9 +441,11 @@ static int cpuset_write_u64(struct cgroup_subsys_state *css, struct cftype *cft,
>   		cpuset_memory_pressure_enabled = !!val;
>   		break;
>   	case FILE_SPREAD_PAGE:
> +		pr_info_once("cpuset.%s is deprecated\n", cft->name);
>   		retval = cpuset_update_flag(CS_SPREAD_PAGE, cs, val);
>   		break;
>   	case FILE_SPREAD_SLAB:
> +		pr_warn_once("cpuset.%s is deprecated\n", cft->name);
>   		retval = cpuset_update_flag(CS_SPREAD_SLAB, cs, val);
>   		break;
>   	default:
Acked-by: Waiman Long <longman@redhat.com>


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 05/11] cgroup/cpuset-v1: Add deprecation messages to mem_exclusive and mem_hardwall
  2025-03-11 12:36 ` [PATCH v2 05/11] cgroup/cpuset-v1: Add deprecation messages to mem_exclusive and mem_hardwall Michal Koutný
@ 2025-03-11 15:08   ` Waiman Long
  0 siblings, 0 replies; 20+ messages in thread
From: Waiman Long @ 2025-03-11 15:08 UTC (permalink / raw)
  To: Michal Koutný, cgroups, linux-kernel; +Cc: Tejun Heo, Johannes Weiner


On 3/11/25 8:36 AM, Michal Koutný wrote:
> The concept of exclusive memory affinity may require complex approaches
> like with cpuset v2 cpu partitions. There is so far no implementation in
> cpuset v2.
> Specific kernel memory affinity may cause unintended (global)
> bottlenecks like kmem limits.
>
> Signed-off-by: Michal Koutný <mkoutny@suse.com>
> ---
>   kernel/cgroup/cpuset-v1.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/kernel/cgroup/cpuset-v1.c b/kernel/cgroup/cpuset-v1.c
> index fea8a0cb7ae1d..b243bdd952d78 100644
> --- a/kernel/cgroup/cpuset-v1.c
> +++ b/kernel/cgroup/cpuset-v1.c
> @@ -424,9 +424,11 @@ static int cpuset_write_u64(struct cgroup_subsys_state *css, struct cftype *cft,
>   		retval = cpuset_update_flag(CS_CPU_EXCLUSIVE, cs, val);
>   		break;
>   	case FILE_MEM_EXCLUSIVE:
> +		pr_info_once("cpuset.%s is deprecated\n", cft->name);
>   		retval = cpuset_update_flag(CS_MEM_EXCLUSIVE, cs, val);
>   		break;
>   	case FILE_MEM_HARDWALL:
> +		pr_info_once("cpuset.%s is deprecated\n", cft->name);
>   		retval = cpuset_update_flag(CS_MEM_HARDWALL, cs, val);
>   		break;
>   	case FILE_SCHED_LOAD_BALANCE:
Acked-by: Waiman Long <longman@redhat.com>


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 06/11] cgroup/cpuset-v1: Add deprecation messages to memory_migrate
  2025-03-11 12:36 ` [PATCH v2 06/11] cgroup/cpuset-v1: Add deprecation messages to memory_migrate Michal Koutný
@ 2025-03-11 15:09   ` Waiman Long
  0 siblings, 0 replies; 20+ messages in thread
From: Waiman Long @ 2025-03-11 15:09 UTC (permalink / raw)
  To: Michal Koutný, cgroups, linux-kernel; +Cc: Tejun Heo, Johannes Weiner


On 3/11/25 8:36 AM, Michal Koutný wrote:
> Memory migration (between cgroups) was given up in v2 due to performance
> reasons of its implementation. Migration between NUMA nodes within one
> memcg may still make sense to modify affinity at runtime though.
>
> Signed-off-by: Michal Koutný <mkoutny@suse.com>
> ---
>   kernel/cgroup/cpuset-v1.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/kernel/cgroup/cpuset-v1.c b/kernel/cgroup/cpuset-v1.c
> index b243bdd952d78..7c37fabcf0ba8 100644
> --- a/kernel/cgroup/cpuset-v1.c
> +++ b/kernel/cgroup/cpuset-v1.c
> @@ -436,6 +436,7 @@ static int cpuset_write_u64(struct cgroup_subsys_state *css, struct cftype *cft,
>   		retval = cpuset_update_flag(CS_SCHED_LOAD_BALANCE, cs, val);
>   		break;
>   	case FILE_MEMORY_MIGRATE:
> +		pr_info_once("cpuset.%s is deprecated\n", cft->name);
>   		retval = cpuset_update_flag(CS_MEMORY_MIGRATE, cs, val);
>   		break;
>   	case FILE_MEMORY_PRESSURE_ENABLED:
Acked-by: Waiman Long <longman@redhat.com>


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 07/11] RFC cgroup/cpuset-v1: Add deprecation messages to sched_relax_domain_level
  2025-03-11 12:36 ` [PATCH v2 07/11] RFC cgroup/cpuset-v1: Add deprecation messages to sched_relax_domain_level Michal Koutný
@ 2025-03-11 15:10   ` Waiman Long
  2025-03-11 15:10   ` Waiman Long
  1 sibling, 0 replies; 20+ messages in thread
From: Waiman Long @ 2025-03-11 15:10 UTC (permalink / raw)
  To: Michal Koutný, cgroups, linux-kernel
  Cc: Hidetoshi Seto, Tejun Heo, Johannes Weiner


On 3/11/25 8:36 AM, Michal Koutný wrote:
> This is not a properly hierarchical resource, it might be better
> implemented based on a sched_attr.
>
> Cc: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
> Signed-off-by: Michal Koutný <mkoutny@suse.com>
> ---
>   kernel/cgroup/cpuset-v1.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/kernel/cgroup/cpuset-v1.c b/kernel/cgroup/cpuset-v1.c
> index 7c37fabcf0ba8..5516df307d520 100644
> --- a/kernel/cgroup/cpuset-v1.c
> +++ b/kernel/cgroup/cpuset-v1.c
> @@ -175,6 +175,7 @@ static int cpuset_write_s64(struct cgroup_subsys_state *css, struct cftype *cft,
>   
>   	switch (type) {
>   	case FILE_SCHED_RELAX_DOMAIN_LEVEL:
> +		pr_info_once("cpuset.%s is deprecated\n", cft->name);
>   		retval = update_relax_domain_level(cs, val);
>   		break;
>   	default:


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 07/11] RFC cgroup/cpuset-v1: Add deprecation messages to sched_relax_domain_level
  2025-03-11 12:36 ` [PATCH v2 07/11] RFC cgroup/cpuset-v1: Add deprecation messages to sched_relax_domain_level Michal Koutný
  2025-03-11 15:10   ` Waiman Long
@ 2025-03-11 15:10   ` Waiman Long
  1 sibling, 0 replies; 20+ messages in thread
From: Waiman Long @ 2025-03-11 15:10 UTC (permalink / raw)
  To: Michal Koutný, cgroups, linux-kernel
  Cc: Hidetoshi Seto, Tejun Heo, Johannes Weiner


On 3/11/25 8:36 AM, Michal Koutný wrote:
> This is not a properly hierarchical resource, it might be better
> implemented based on a sched_attr.
>
> Cc: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
> Signed-off-by: Michal Koutný <mkoutny@suse.com>
> ---
>   kernel/cgroup/cpuset-v1.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/kernel/cgroup/cpuset-v1.c b/kernel/cgroup/cpuset-v1.c
> index 7c37fabcf0ba8..5516df307d520 100644
> --- a/kernel/cgroup/cpuset-v1.c
> +++ b/kernel/cgroup/cpuset-v1.c
> @@ -175,6 +175,7 @@ static int cpuset_write_s64(struct cgroup_subsys_state *css, struct cftype *cft,
>   
>   	switch (type) {
>   	case FILE_SCHED_RELAX_DOMAIN_LEVEL:
> +		pr_info_once("cpuset.%s is deprecated\n", cft->name);
>   		retval = update_relax_domain_level(cs, val);
>   		break;
>   	default:
Acked-by: Waiman Long <longman@redhat.com>


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 00/11] cgroup v1 deprecation messages
  2025-03-11 12:36 [PATCH v2 00/11] cgroup v1 deprecation messages Michal Koutný
                   ` (10 preceding siblings ...)
  2025-03-11 12:36 ` [PATCH v2 11/11] blk-cgroup: Simplify policy files registration Michal Koutný
@ 2025-03-11 18:56 ` Jens Axboe
  2025-03-11 19:23 ` Tejun Heo
  12 siblings, 0 replies; 20+ messages in thread
From: Jens Axboe @ 2025-03-11 18:56 UTC (permalink / raw)
  To: Michal Koutný
  Cc: cgroups, linux-block, linux-kernel, linux-doc, linux-mm,
	Michal Koutný, Josef Bacik, Waiman Long, Jonathan Corbet,
	Andrew Morton, Shakeel Butt, Roman Gushchin, Johannes Weiner,
	Tejun Heo, Muchun Song, Michal Hocko

> Memory controller had begun to print warning messages when using some
> attributes that do no have a counterpart in its cgroup v2
> implementation. This is informative to users who run (unwittingly) on v1
> or to distros that run v1 (they can learn about such users or prepare
> for disabling v1 configs).
>
> I consider the deprecated files in three categories:
>   - RE) replacement exists,
>   - DN) dropped as non-ideal concept (e.g. non-hierarchical resources),
>   - NE) not evaluated (yet).
>
> For RE, I added the replacement into the warning message, DN have only a
> plain deprecation message and I marked the commits with NE as RFC.
> Also I'd be happy if you would point out some forgotten knobs that'd
> deserve similar warnings.
>
> The level of messages is info to avoid too much noise (may be increased
> in future when there are fewer users). Some knobs from DN have warn
> level.
>
> The net_cls and net_prio controllers that only exist on v1 hierarchies
> have no straightforward action for users (replacement would rely on net
> NS or eBPF), so messages for their usage are omitted, although it'd be
> good to eventually retire that code in favor of aforementioned.
>
> At the end are some cleanup patches I encountered en route.

For the block related parts, as I'm assuming Tejun will pick this up:

Acked-by: Jens Axboe <axboe@kernel.dk>

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 00/11] cgroup v1 deprecation messages
  2025-03-11 12:36 [PATCH v2 00/11] cgroup v1 deprecation messages Michal Koutný
                   ` (11 preceding siblings ...)
  2025-03-11 18:56 ` [PATCH v2 00/11] cgroup v1 deprecation messages Jens Axboe
@ 2025-03-11 19:23 ` Tejun Heo
  12 siblings, 0 replies; 20+ messages in thread
From: Tejun Heo @ 2025-03-11 19:23 UTC (permalink / raw)
  To: Michal Koutný
  Cc: cgroups, linux-block, linux-kernel, linux-doc, linux-mm,
	Josef Bacik, Waiman Long, Jonathan Corbet, Andrew Morton,
	Shakeel Butt, Roman Gushchin, Johannes Weiner, Muchun Song,
	Michal Hocko, Jens Axboe

On Tue, Mar 11, 2025 at 01:36:17PM +0100, Michal Koutný wrote:
> Memory controller had begun to print warning messages when using some
> attributes that do no have a counterpart in its cgroup v2
> implementation. This is informative to users who run (unwittingly) on v1
> or to distros that run v1 (they can learn about such users or prepare
> for disabling v1 configs).
> 
> I consider the deprecated files in three categories:
>   - RE) replacement exists,
>   - DN) dropped as non-ideal concept (e.g. non-hierarchical resources),
>   - NE) not evaluated (yet).
> 
> For RE, I added the replacement into the warning message, DN have only a
> plain deprecation message and I marked the commits with NE as RFC.
> Also I'd be happy if you would point out some forgotten knobs that'd
> deserve similar warnings.
> 
> The level of messages is info to avoid too much noise (may be increased
> in future when there are fewer users). Some knobs from DN have warn
> level.
> 
> The net_cls and net_prio controllers that only exist on v1 hierarchies
> have no straightforward action for users (replacement would rely on net
> NS or eBPF), so messages for their usage are omitted, although it'd be
> good to eventually retire that code in favor of aforementioned.
> 
> At the end are some cleanup patches I encountered en route.

Applied to cgroup/for-6.15.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2025-03-11 19:23 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-11 12:36 [PATCH v2 00/11] cgroup v1 deprecation messages Michal Koutný
2025-03-11 12:36 ` [PATCH v2 01/11] cgroup/cpuset-v1: Add deprecation messages to sched_load_balance and memory_pressure_enabled Michal Koutný
2025-03-11 14:02   ` Waiman Long
2025-03-11 12:36 ` [PATCH v2 02/11] cgroup/cpuset-v1: Add deprecation messages to memory_spread_page and memory_spread_slab Michal Koutný
2025-03-11 15:07   ` Waiman Long
2025-03-11 12:36 ` [PATCH v2 03/11] cgroup/blkio: Add deprecation messages to reset_stats Michal Koutný
2025-03-11 12:36 ` [PATCH v2 04/11] cgroup: Print message when /proc/cgroups is read on v2-only system Michal Koutný
2025-03-11 12:36 ` [PATCH v2 05/11] cgroup/cpuset-v1: Add deprecation messages to mem_exclusive and mem_hardwall Michal Koutný
2025-03-11 15:08   ` Waiman Long
2025-03-11 12:36 ` [PATCH v2 06/11] cgroup/cpuset-v1: Add deprecation messages to memory_migrate Michal Koutný
2025-03-11 15:09   ` Waiman Long
2025-03-11 12:36 ` [PATCH v2 07/11] RFC cgroup/cpuset-v1: Add deprecation messages to sched_relax_domain_level Michal Koutný
2025-03-11 15:10   ` Waiman Long
2025-03-11 15:10   ` Waiman Long
2025-03-11 12:36 ` [PATCH v2 08/11] mm: Add transformation message for per-memcg swappiness Michal Koutný
2025-03-11 12:36 ` [PATCH v2 09/11] cgroup: Add deprecation message to legacy freezer controller Michal Koutný
2025-03-11 12:36 ` [PATCH v2 10/11] cgroup: Update file naming comment Michal Koutný
2025-03-11 12:36 ` [PATCH v2 11/11] blk-cgroup: Simplify policy files registration Michal Koutný
2025-03-11 18:56 ` [PATCH v2 00/11] cgroup v1 deprecation messages Jens Axboe
2025-03-11 19:23 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox