Skip to content

Commit 3b029c0

Browse files
committed
Merge tag 'cgroup-for-7.2-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Pull cgroup fixes from Tejun Heo: - A cpuset that never set its memory nodes could divide by zero when a task's mempolicy rebinds on CPU hotplug. Rebind against the effective nodes, which are always populated - Documentation fixes for memory.stat, io.stat, and the misc and v1 RDMA controllers * tag 'cgroup-for-7.2-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: Docs/admin-guide/cgroup-v2: note blkcg_debug_stats gates io.latency stats Docs/admin-guide/cgroup-v1: document rdma.peak, rdma.events and rdma.events.local Docs/admin-guide/cgroup-v2: drop stale misc interface file count cgroup/cpuset: rebind mm mempolicy to effective_mems, not mems_allowed Docs/admin-guide/cgroup-v2: fix memory.stat doc details
2 parents f7574d3 + 97fef60 commit 3b029c0

3 files changed

Lines changed: 84 additions & 9 deletions

File tree

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

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ RDMA Controller
99
1-2. Why RDMA controller needed?
1010
1-3. How is RDMA controller implemented?
1111
2. Usage Examples
12+
3. RDMA Interface Files
1213
1314
1. Overview
1415
===========
@@ -115,3 +116,68 @@ Following resources can be accounted by rdma controller.
115116
(d) Delete resource limit::
116117

117118
echo mlx4_0 hca_handle=max hca_object=max > /sys/fs/cgroup/rdma/1/rdma.max
119+
120+
3. RDMA Interface Files
121+
========================
122+
123+
The following interface files are available in each non-root RDMA cgroup.
124+
125+
rdma.max
126+
A read-write file which describes the configured resource limit
127+
for an RDMA/IB device. See the Usage Examples above.
128+
129+
rdma.current
130+
A read-only file which describes the current resource usage.
131+
132+
rdma.peak
133+
A read-only nested-keyed file which shows the historical high
134+
watermark of resource usage per device since the cgroup was created.
135+
136+
An example for mlx4 and ocrdma device follows::
137+
138+
mlx4_0 hca_handle=1 hca_object=20
139+
ocrdma1 hca_handle=0 hca_object=23
140+
141+
rdma.events
142+
A read-only nested-keyed file which exists on non-root cgroups
143+
and contains the following keys:
144+
145+
max
146+
The number of times a process in this cgroup or its
147+
descendants attempted an RDMA resource allocation that
148+
was rejected because a rdma.max limit in the subtree
149+
was reached. This is a hierarchical counter propagated
150+
upward to all ancestor cgroups. A value change in this
151+
file generates a file modified event.
152+
153+
alloc_fail
154+
The number of RDMA resource allocation attempts that
155+
originated in this cgroup or its descendants and failed
156+
due to a rdma.max limit being reached. This is a
157+
hierarchical counter propagated upward.
158+
159+
An example for mlx4 device follows::
160+
161+
mlx4_0 hca_handle.max=5 hca_handle.alloc_fail=3 hca_object.max=0 hca_object.alloc_fail=0
162+
163+
rdma.events.local
164+
Similar to rdma.events but the fields are local to the cgroup,
165+
i.e. not hierarchical. The file modified event generated on this
166+
file reflects only the local events.
167+
168+
The following nested keys are defined.
169+
170+
max
171+
The number of times a process in this cgroup or its
172+
descendants attempted an RDMA resource allocation that
173+
was rejected because this cgroup's own rdma.max limit
174+
was reached.
175+
176+
alloc_fail
177+
The number of RDMA resource allocation attempts
178+
originating from this cgroup that failed due to this
179+
cgroup's or an ancestor's rdma.max limit.
180+
181+
An example for mlx4 device follows::
182+
183+
mlx4_0 hca_handle.max=5 hca_handle.alloc_fail=0 hca_object.max=0 hca_object.alloc_fail=0

Documentation/admin-guide/cgroup-v2.rst

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,7 +1570,7 @@ The following nested keys are defined.
15701570
sock (npn)
15711571
Amount of memory used in network transmission buffers
15721572

1573-
vmalloc (npn)
1573+
vmalloc
15741574
Amount of memory used for vmap backed memory.
15751575

15761576
shmem
@@ -1735,7 +1735,7 @@ The following nested keys are defined.
17351735
Number of pages written from zswap to swap.
17361736

17371737
zswap_incomp
1738-
Number of incompressible pages currently stored in zswap
1738+
Amount of memory used by incompressible pages currently stored in zswap
17391739
without compression. These pages could not be compressed to
17401740
a size smaller than PAGE_SIZE, so they are stored as-is.
17411741

@@ -2257,10 +2257,11 @@ groups D and F will influence each other. Group G will influence nobody::
22572257
So the ideal way to configure this is to set io.latency in groups A, B, and C.
22582258
Generally you do not want to set a value lower than the latency your device
22592259
supports. Experiment to find the value that works best for your workload.
2260-
Start at higher than the expected latency for your device and watch the
2261-
avg_lat value in io.stat for your workload group to get an idea of the
2262-
latency you see during normal operation. Use the avg_lat value as a basis for
2263-
your real setting, setting at 10-15% higher than the value in io.stat.
2260+
Start at higher than the expected latency for your device and, with
2261+
blkcg_debug_stats enabled, watch the avg_lat value in io.stat for your
2262+
workload group to get an idea of the latency you see during normal operation.
2263+
Use the avg_lat value as a basis for your real setting, setting at 10-15%
2264+
higher than the value in io.stat.
22642265

22652266
How IO Latency Throttling Works
22662267
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2298,7 +2299,9 @@ IO Latency Interface Files
22982299

22992300
io.stat
23002301
If the controller is enabled you will see extra stats in io.stat in
2301-
addition to the normal ones.
2302+
addition to the normal ones. These debug stats are only emitted when
2303+
the blkcg_debug_stats module parameter is enabled (it is disabled by
2304+
default).
23022305

23032306
depth
23042307
This is the current queue depth for the group.
@@ -2934,7 +2937,8 @@ include/linux/misc_cgroup.h.
29342937
Misc Interface Files
29352938
~~~~~~~~~~~~~~~~~~~~
29362939

2937-
Miscellaneous controller provides 3 interface files. If two misc resources (res_a and res_b) are registered then:
2940+
Miscellaneous controller provides the following interface files. If two misc
2941+
resources (res_a and res_b) are registered then:
29382942

29392943
misc.capacity
29402944
A read-only flat-keyed file shown only in the root cgroup. It shows

kernel/cgroup/cpuset.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2653,7 +2653,12 @@ void cpuset_update_tasks_nodemask(struct cpuset *cs)
26532653

26542654
migrate = is_memory_migrate(cs);
26552655

2656-
mpol_rebind_mm(mm, &cs->mems_allowed);
2656+
/*
2657+
* For v1 we can have empty effective_mems, but we cannot
2658+
* attach any tasks (see cpuset_can_attach_check()). For v2,
2659+
* effective_mems is guaranteed to not be empty.
2660+
*/
2661+
mpol_rebind_mm(mm, &cs->effective_mems);
26572662
if (migrate)
26582663
cpuset_migrate_mm(mm, &cs->old_mems_allowed, &newmems);
26592664
else

0 commit comments

Comments
 (0)