Commit d23b5c5
cgroup: Make operations on the cgroup root_list RCU safe
At present, when we perform operations on the cgroup root_list, we must
hold the cgroup_mutex, which is a relatively heavyweight lock. In reality,
we can make operations on this list RCU-safe, eliminating the need to hold
the cgroup_mutex during traversal. Modifications to the list only occur in
the cgroup root setup and destroy paths, which should be infrequent in a
production environment. In contrast, traversal may occur frequently.
Therefore, making it RCU-safe would be beneficial.
Signed-off-by: Yafang Shao <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>1 parent 96a2b48 commit d23b5c5
File tree
3 files changed
+19
-8
lines changed- include/linux
- kernel/cgroup
3 files changed
+19
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
| 566 | + | |
566 | 567 | | |
567 | 568 | | |
568 | 569 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
| 174 | + | |
174 | 175 | | |
175 | 176 | | |
176 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1315 | 1315 | | |
1316 | 1316 | | |
1317 | 1317 | | |
1318 | | - | |
| 1318 | + | |
1319 | 1319 | | |
1320 | 1320 | | |
1321 | 1321 | | |
| |||
1348 | 1348 | | |
1349 | 1349 | | |
1350 | 1350 | | |
1351 | | - | |
| 1351 | + | |
1352 | 1352 | | |
1353 | 1353 | | |
1354 | 1354 | | |
| |||
1389 | 1389 | | |
1390 | 1390 | | |
1391 | 1391 | | |
1392 | | - | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
1393 | 1401 | | |
1394 | 1402 | | |
1395 | 1403 | | |
| |||
1448 | 1456 | | |
1449 | 1457 | | |
1450 | 1458 | | |
1451 | | - | |
1452 | 1459 | | |
1453 | 1460 | | |
1454 | 1461 | | |
1455 | 1462 | | |
1456 | 1463 | | |
1457 | 1464 | | |
1458 | 1465 | | |
1459 | | - | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
1460 | 1469 | | |
1461 | 1470 | | |
1462 | 1471 | | |
| |||
2031 | 2040 | | |
2032 | 2041 | | |
2033 | 2042 | | |
2034 | | - | |
| 2043 | + | |
2035 | 2044 | | |
2036 | 2045 | | |
2037 | 2046 | | |
| |||
2114 | 2123 | | |
2115 | 2124 | | |
2116 | 2125 | | |
2117 | | - | |
| 2126 | + | |
2118 | 2127 | | |
2119 | 2128 | | |
2120 | 2129 | | |
| |||
0 commit comments