Commit ca174c7
cgroup/cpuset: Call rebuild_sched_domains() directly in hotplug
Besides deferring the call to housekeeping_update(), commit 6df415a
("cgroup/cpuset: Defer housekeeping_update() calls from CPU hotplug
to workqueue") also defers the rebuild_sched_domains() call to
the workqueue. So a new offline CPU may still be in a sched domain
or new online CPU not showing up in the sched domains for a short
transition period. That could be a problem in some corner cases and
can be the cause of a reported test failure[1]. Fix it by calling
rebuild_sched_domains_cpuslocked() directly in hotplug as before. If
isolated partition invalidation or recreation is being done, the
housekeeping_update() call to update the housekeeping cpumasks will
still be deferred to a workqueue.
In commit 3bfe479 ("cgroup/cpuset: Move
housekeeping_update()/rebuild_sched_domains() together"),
housekeeping_update() is called before rebuild_sched_domains() because
it needs to access the HK_TYPE_DOMAIN housekeeping cpumask. That is now
changed to use the static HK_TYPE_DOMAIN_BOOT cpumask as HK_TYPE_DOMAIN
cpumask is now changeable at run time. As a result, we can move the
rebuild_sched_domains() call before housekeeping_update() with
the slight advantage that it will be done in the same cpus_read_lock
critical section without the possibility of interference by a concurrent
cpu hot add/remove operation.
As it doesn't make sense to acquire cpuset_mutex/cpuset_top_mutex after
calling housekeeping_update() and immediately release them again, move
the cpuset_full_unlock() operation inside update_hk_sched_domains()
and rename it to cpuset_update_sd_hk_unlock() to signify that it will
release the full set of locks.
[1] https://lore.kernel.org/lkml/[email protected]
Fixes: 6df415a ("cgroup/cpuset: Defer housekeeping_update() calls from CPU hotplug to workqueue")
Tested-by: Jon Hunter <[email protected]>
Reviewed-by: Chen Ridong <[email protected]>
Signed-off-by: Waiman Long <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>1 parent 5ee8dbf commit ca174c7
1 file changed
Lines changed: 31 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
879 | 879 | | |
880 | 880 | | |
881 | 881 | | |
882 | | - | |
| 882 | + | |
883 | 883 | | |
884 | 884 | | |
885 | 885 | | |
| |||
888 | 888 | | |
889 | 889 | | |
890 | 890 | | |
891 | | - | |
| 891 | + | |
892 | 892 | | |
893 | 893 | | |
894 | 894 | | |
| |||
1329 | 1329 | | |
1330 | 1330 | | |
1331 | 1331 | | |
1332 | | - | |
| 1332 | + | |
1333 | 1333 | | |
1334 | | - | |
1335 | | - | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
1336 | 1337 | | |
1337 | | - | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
1338 | 1341 | | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
1339 | 1346 | | |
1340 | | - | |
1341 | 1347 | | |
1342 | | - | |
1343 | 1348 | | |
1344 | 1349 | | |
1345 | 1350 | | |
| |||
1350 | 1355 | | |
1351 | 1356 | | |
1352 | 1357 | | |
1353 | | - | |
1354 | | - | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
1355 | 1361 | | |
1356 | | - | |
1357 | | - | |
1358 | | - | |
1359 | 1362 | | |
1360 | 1363 | | |
1361 | 1364 | | |
1362 | | - | |
| 1365 | + | |
1363 | 1366 | | |
1364 | 1367 | | |
1365 | 1368 | | |
1366 | 1369 | | |
1367 | | - | |
1368 | | - | |
| 1370 | + | |
1369 | 1371 | | |
1370 | 1372 | | |
1371 | 1373 | | |
| |||
3230 | 3232 | | |
3231 | 3233 | | |
3232 | 3234 | | |
3233 | | - | |
3234 | | - | |
| 3235 | + | |
3235 | 3236 | | |
3236 | 3237 | | |
3237 | 3238 | | |
| |||
3338 | 3339 | | |
3339 | 3340 | | |
3340 | 3341 | | |
3341 | | - | |
3342 | | - | |
| 3342 | + | |
3343 | 3343 | | |
3344 | 3344 | | |
3345 | 3345 | | |
| |||
3513 | 3513 | | |
3514 | 3514 | | |
3515 | 3515 | | |
3516 | | - | |
3517 | | - | |
| 3516 | + | |
3518 | 3517 | | |
3519 | 3518 | | |
3520 | 3519 | | |
| |||
3923 | 3922 | | |
3924 | 3923 | | |
3925 | 3924 | | |
3926 | | - | |
3927 | 3925 | | |
3928 | | - | |
3929 | | - | |
3930 | | - | |
| 3926 | + | |
| 3927 | + | |
| 3928 | + | |
| 3929 | + | |
| 3930 | + | |
| 3931 | + | |
3931 | 3932 | | |
3932 | 3933 | | |
3933 | 3934 | | |
| |||
3936 | 3937 | | |
3937 | 3938 | | |
3938 | 3939 | | |
3939 | | - | |
3940 | | - | |
| 3940 | + | |
| 3941 | + | |
| 3942 | + | |
| 3943 | + | |
3941 | 3944 | | |
3942 | 3945 | | |
3943 | 3946 | | |
| |||
0 commit comments