Commit 5c5c662
committed
cgroup/cpuset: Enforce at most one rebuild_sched_domains_locked() call per operation
jira NONE_AUTOMATION
Rebuild_History Non-Buildable kernel-5.14.0-570.17.1.el9_6
commit-author Waiman Long <[email protected]>
commit a040c35
Since commit ff0ce72 ("cgroup/cpuset: Eliminate unncessary
sched domains rebuilds in hotplug"), there is only one
rebuild_sched_domains_locked() call per hotplug operation. However,
writing to the various cpuset control files may still casue more than
one rebuild_sched_domains_locked() call to happen in some cases.
Juri had found that two rebuild_sched_domains_locked() calls in
update_prstate(), one from update_cpumasks_hier() and another one from
update_partition_sd_lb() could cause cpuset partition to be created
with null total_bw for DL tasks. IOW, DL tasks may not be scheduled
correctly in such a partition.
A sample command sequence that can reproduce null total_bw is as
follows.
# echo Y >/sys/kernel/debug/sched/verbose
# echo +cpuset >/sys/fs/cgroup/cgroup.subtree_control
# mkdir /sys/fs/cgroup/test
# echo 0-7 > /sys/fs/cgroup/test/cpuset.cpus
# echo 6-7 > /sys/fs/cgroup/test/cpuset.cpus.exclusive
# echo root >/sys/fs/cgroup/test/cpuset.cpus.partition
Fix this double rebuild_sched_domains_locked() calls problem
by replacing existing calls with cpuset_force_rebuild() except
the rebuild_sched_domains_cpuslocked() call at the end of
cpuset_handle_hotplug(). Checking of the force_sd_rebuild flag is
now done at the end of cpuset_write_resmask() and update_prstate()
to determine if rebuild_sched_domains_locked() should be called or not.
The cpuset v1 code can still call rebuild_sched_domains_locked()
directly as double rebuild_sched_domains_locked() calls is not possible.
Reported-by: Juri Lelli <[email protected]>
Closes: https://lore.kernel.org/lkml/[email protected]/
Signed-off-by: Waiman Long <[email protected]>
Tested-by: Juri Lelli <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
(cherry picked from commit a040c35)
Signed-off-by: Jonathan Maple <[email protected]>1 parent e35c088 commit 5c5c662
1 file changed
+33
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
238 | | - | |
239 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
240 | 250 | | |
241 | 251 | | |
242 | 252 | | |
| |||
1273 | 1283 | | |
1274 | 1284 | | |
1275 | 1285 | | |
| 1286 | + | |
1276 | 1287 | | |
1277 | 1288 | | |
1278 | 1289 | | |
| |||
1449 | 1460 | | |
1450 | 1461 | | |
1451 | 1462 | | |
1452 | | - | |
1453 | | - | |
| 1463 | + | |
| 1464 | + | |
1454 | 1465 | | |
1455 | 1466 | | |
1456 | 1467 | | |
| |||
1797 | 1808 | | |
1798 | 1809 | | |
1799 | 1810 | | |
1800 | | - | |
1801 | | - | |
| 1811 | + | |
| 1812 | + | |
1802 | 1813 | | |
1803 | 1814 | | |
1804 | 1815 | | |
| |||
2391 | 2402 | | |
2392 | 2403 | | |
2393 | 2404 | | |
2394 | | - | |
2395 | | - | |
| 2405 | + | |
| 2406 | + | |
2396 | 2407 | | |
2397 | 2408 | | |
2398 | 2409 | | |
| |||
3047 | 3058 | | |
3048 | 3059 | | |
3049 | 3060 | | |
3050 | | - | |
3051 | | - | |
3052 | | - | |
| 3061 | + | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
3053 | 3068 | | |
3054 | 3069 | | |
3055 | 3070 | | |
| |||
3169 | 3184 | | |
3170 | 3185 | | |
3171 | 3186 | | |
| 3187 | + | |
| 3188 | + | |
3172 | 3189 | | |
3173 | 3190 | | |
3174 | 3191 | | |
| |||
3666 | 3683 | | |
3667 | 3684 | | |
3668 | 3685 | | |
| 3686 | + | |
| 3687 | + | |
3669 | 3688 | | |
3670 | 3689 | | |
3671 | 3690 | | |
| |||
4652 | 4671 | | |
4653 | 4672 | | |
4654 | 4673 | | |
4655 | | - | |
4656 | | - | |
4657 | | - | |
| 4674 | + | |
| 4675 | + | |
4658 | 4676 | | |
4659 | | - | |
4660 | 4677 | | |
4661 | 4678 | | |
4662 | 4679 | | |
| |||
0 commit comments