Skip to content

Commit 94dc216

Browse files
committed
Merge tag 'cgroup-for-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Pull cgroup updates from Tejun Heo: - Add deprecation info messages to cgroup1-only features - rstat updates including a bug fix and breaking up a critical section to reduce interrupt latency impact - Other misc and doc updates * tag 'cgroup-for-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup: rstat: Cleanup flushing functions and locking cgroup/rstat: avoid disabling irqs for O(num_cpu) mm: Fix a build breakage in memcontrol-v1.c blk-cgroup: Simplify policy files registration cgroup: Update file naming comment cgroup: Add deprecation message to legacy freezer controller mm: Add transformation message for per-memcg swappiness RFC cgroup/cpuset-v1: Add deprecation messages to sched_relax_domain_level cgroup/cpuset-v1: Add deprecation messages to memory_migrate cgroup/cpuset-v1: Add deprecation messages to mem_exclusive and mem_hardwall cgroup: Print message when /proc/cgroups is read on v2-only system cgroup/blkio: Add deprecation messages to reset_stats cgroup/cpuset-v1: Add deprecation messages to memory_spread_page and memory_spread_slab cgroup/cpuset-v1: Add deprecation messages to sched_load_balance and memory_pressure_enabled cgroup, docs: Be explicit about independence of RT_GROUP_SCHED and non-cpu controllers cgroup/rstat: Fix forceidle time in cpu.stat cgroup/misc: Remove unused misc_cg_res_total_usage cgroup/cpuset: Move procfs cpuset attribute under cgroup-v1.c cgroup: update comment about dropping cgroup kn refs
2 parents b05f8fb + 093c881 commit 94dc216

File tree

18 files changed

+142
-188
lines changed

18 files changed

+142
-188
lines changed

Documentation/admin-guide/cgroup-v1/freezer-subsystem.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,7 @@ to unfreeze all tasks in the container::
125125

126126
This is the basic mechanism which should do the right thing for user space task
127127
in a simple scenario.
128+
129+
This freezer implementation is affected by shortcomings (see commit
130+
76f969e8948d8 ("cgroup: cgroup v2 freezer")) and cgroup v2 freezer is
131+
recommended.

Documentation/admin-guide/cgroup-v1/memory.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ Brief summary of control files.
9090
used.
9191
memory.swappiness set/show swappiness parameter of vmscan
9292
(See sysctl's vm.swappiness)
93+
Per memcg knob does not exist in cgroup v2.
9394
memory.move_charge_at_immigrate This knob is deprecated.
9495
memory.oom_control set/show oom controls.
9596
This knob is deprecated and shouldn't be

Documentation/admin-guide/cgroup-v2.rst

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,15 +1076,20 @@ cpufreq governor about the minimum desired frequency which should always be
10761076
provided by a CPU, as well as the maximum desired frequency, which should not
10771077
be exceeded by a CPU.
10781078

1079-
WARNING: cgroup2 doesn't yet support control of realtime processes. For
1080-
a kernel built with the CONFIG_RT_GROUP_SCHED option enabled for group
1081-
scheduling of realtime processes, the cpu controller can only be enabled
1082-
when all RT processes are in the root cgroup. This limitation does
1083-
not apply if CONFIG_RT_GROUP_SCHED is disabled. Be aware that system
1084-
management software may already have placed RT processes into nonroot
1085-
cgroups during the system boot process, and these processes may need
1086-
to be moved to the root cgroup before the cpu controller can be enabled
1087-
with a CONFIG_RT_GROUP_SCHED enabled kernel.
1079+
WARNING: cgroup2 cpu controller doesn't yet fully support the control of
1080+
realtime processes. For a kernel built with the CONFIG_RT_GROUP_SCHED option
1081+
enabled for group scheduling of realtime processes, the cpu controller can only
1082+
be enabled when all RT processes are in the root cgroup. Be aware that system
1083+
management software may already have placed RT processes into non-root cgroups
1084+
during the system boot process, and these processes may need to be moved to the
1085+
root cgroup before the cpu controller can be enabled with a
1086+
CONFIG_RT_GROUP_SCHED enabled kernel.
1087+
1088+
With CONFIG_RT_GROUP_SCHED disabled, this limitation does not apply and some of
1089+
the interface files either affect realtime processes or account for them. See
1090+
the following section for details. Only the cpu controller is affected by
1091+
CONFIG_RT_GROUP_SCHED. Other controllers can be used for the resource control of
1092+
realtime processes irrespective of CONFIG_RT_GROUP_SCHED.
10881093

10891094

10901095
CPU Interface Files

block/blk-cgroup.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,7 @@ static int blkcg_reset_stats(struct cgroup_subsys_state *css,
659659
struct blkcg_gq *blkg;
660660
int i;
661661

662+
pr_info_once("blkio.%s is deprecated\n", cftype->name);
662663
mutex_lock(&blkcg_pol_mutex);
663664
spin_lock_irq(&blkcg->lock);
664665

@@ -1770,12 +1771,15 @@ int blkcg_policy_register(struct blkcg_policy *pol)
17701771
mutex_unlock(&blkcg_pol_mutex);
17711772

17721773
/* everything is in place, add intf files for the new policy */
1773-
if (pol->dfl_cftypes)
1774+
if (pol->dfl_cftypes == pol->legacy_cftypes) {
1775+
WARN_ON(cgroup_add_cftypes(&io_cgrp_subsys,
1776+
pol->dfl_cftypes));
1777+
} else {
17741778
WARN_ON(cgroup_add_dfl_cftypes(&io_cgrp_subsys,
17751779
pol->dfl_cftypes));
1776-
if (pol->legacy_cftypes)
17771780
WARN_ON(cgroup_add_legacy_cftypes(&io_cgrp_subsys,
17781781
pol->legacy_cftypes));
1782+
}
17791783
mutex_unlock(&blkcg_pol_register_mutex);
17801784
return 0;
17811785

block/blk-ioprio.c

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -113,27 +113,18 @@ static void ioprio_free_cpd(struct blkcg_policy_data *cpd)
113113
kfree(blkcg);
114114
}
115115

116-
#define IOPRIO_ATTRS \
117-
{ \
118-
.name = "prio.class", \
119-
.seq_show = ioprio_show_prio_policy, \
120-
.write = ioprio_set_prio_policy, \
121-
}, \
122-
{ } /* sentinel */
123-
124-
/* cgroup v2 attributes */
125116
static struct cftype ioprio_files[] = {
126-
IOPRIO_ATTRS
127-
};
128-
129-
/* cgroup v1 attributes */
130-
static struct cftype ioprio_legacy_files[] = {
131-
IOPRIO_ATTRS
117+
{
118+
.name = "prio.class",
119+
.seq_show = ioprio_show_prio_policy,
120+
.write = ioprio_set_prio_policy,
121+
},
122+
{ } /* sentinel */
132123
};
133124

134125
static struct blkcg_policy ioprio_policy = {
135126
.dfl_cftypes = ioprio_files,
136-
.legacy_cftypes = ioprio_legacy_files,
127+
.legacy_cftypes = ioprio_files,
137128

138129
.cpd_alloc_fn = ioprio_alloc_cpd,
139130
.cpd_free_fn = ioprio_free_cpd,

include/linux/cgroup-defs.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -619,9 +619,8 @@ struct cgroup_root {
619619
*/
620620
struct cftype {
621621
/*
622-
* By convention, the name should begin with the name of the
623-
* subsystem, followed by a period. Zero length string indicates
624-
* end of cftype array.
622+
* Name of the subsystem is prepended in cgroup_file_name().
623+
* Zero length string indicates end of cftype array.
625624
*/
626625
char name[MAX_CFTYPE_NAME];
627626
unsigned long private;

include/linux/cgroup.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from);
113113

114114
int cgroup_add_dfl_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
115115
int cgroup_add_legacy_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
116+
int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
116117
int cgroup_rm_cftypes(struct cftype *cfts);
117118
void cgroup_file_notify(struct cgroup_file *cfile);
118119
void cgroup_file_show(struct cgroup_file *cfile, bool show);
@@ -689,8 +690,6 @@ static inline void cgroup_path_from_kernfs_id(u64 id, char *buf, size_t buflen)
689690
*/
690691
void cgroup_rstat_updated(struct cgroup *cgrp, int cpu);
691692
void cgroup_rstat_flush(struct cgroup *cgrp);
692-
void cgroup_rstat_flush_hold(struct cgroup *cgrp);
693-
void cgroup_rstat_flush_release(struct cgroup *cgrp);
694693

695694
/*
696695
* Basic resource stats.

include/linux/misc_cgroup.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ struct misc_cg {
6060
struct misc_res res[MISC_CG_RES_TYPES];
6161
};
6262

63-
u64 misc_cg_res_total_usage(enum misc_res_type type);
6463
int misc_cg_set_capacity(enum misc_res_type type, u64 capacity);
6564
int misc_cg_try_charge(enum misc_res_type type, struct misc_cg *cg, u64 amount);
6665
void misc_cg_uncharge(enum misc_res_type type, struct misc_cg *cg, u64 amount);
@@ -104,11 +103,6 @@ static inline void put_misc_cg(struct misc_cg *cg)
104103

105104
#else /* !CONFIG_CGROUP_MISC */
106105

107-
static inline u64 misc_cg_res_total_usage(enum misc_res_type type)
108-
{
109-
return 0;
110-
}
111-
112106
static inline int misc_cg_set_capacity(enum misc_res_type type, u64 capacity)
113107
{
114108
return 0;

init/Kconfig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,15 +1198,16 @@ config CPUSETS_V1
11981198
help
11991199
Legacy cgroup v1 cpusets controller which has been deprecated by
12001200
cgroup v2 implementation. The v1 is there for legacy applications
1201-
which haven't migrated to the new cgroup v2 interface yet. If you
1201+
which haven't migrated to the new cgroup v2 interface yet. Legacy
1202+
interface includes cpuset filesystem and /proc/<pid>/cpuset. If you
12021203
do not have any such application then you are completely fine leaving
12031204
this option disabled.
12041205

12051206
Say N if unsure.
12061207

12071208
config PROC_PID_CPUSET
12081209
bool "Include legacy /proc/<pid>/cpuset file"
1209-
depends on CPUSETS
1210+
depends on CPUSETS_V1
12101211
default y
12111212

12121213
config CGROUP_DEVICE

kernel/cgroup/cgroup-internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ struct cgroup_mgctx {
168168

169169
extern struct cgroup_subsys *cgroup_subsys[];
170170
extern struct list_head cgroup_roots;
171+
extern bool cgrp_dfl_visible;
171172

172173
/* iterate across the hierarchies */
173174
#define for_each_root(root) \

0 commit comments

Comments
 (0)