* [PATCH v2 00/11] cgroup v1 deprecation messages
@ 2025-03-11 12:36 Michal Koutný
2025-03-11 12:36 ` [PATCH v2 08/11] mm: Add transformation message for per-memcg swappiness Michal Koutný
` (2 more replies)
0 siblings, 3 replies; 4+ 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] 4+ 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ý
@ 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
2 siblings, 0 replies; 4+ 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 [flat|nested] 4+ 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ý
2025-03-11 12:36 ` [PATCH v2 08/11] mm: Add transformation message for per-memcg swappiness Michal Koutný
@ 2025-03-11 18:56 ` Jens Axboe
2025-03-11 19:23 ` Tejun Heo
2 siblings, 0 replies; 4+ 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] 4+ 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ý
2025-03-11 12:36 ` [PATCH v2 08/11] mm: Add transformation message for per-memcg swappiness Michal Koutný
2025-03-11 18:56 ` [PATCH v2 00/11] cgroup v1 deprecation messages Jens Axboe
@ 2025-03-11 19:23 ` Tejun Heo
2 siblings, 0 replies; 4+ 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] 4+ messages in thread
end of thread, other threads:[~2025-03-11 19:24 UTC | newest]
Thread overview: 4+ 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 08/11] mm: Add transformation message for per-memcg swappiness 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