Commit a040c35
cgroup/cpuset: Enforce at most one rebuild_sched_domains_locked() call per operation
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 <juri.lelli@redhat.com>
Closes: https://lore.kernel.org/lkml/ZyuUcJDPBln1BK1Y@jlelli-thinkpadt14gen4.remote.csb/
Signed-off-by: Waiman Long <longman@redhat.com>
Tested-by: Juri Lelli <juri.lelli@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>1 parent bcd7012 commit a040c35
1 file changed
Lines changed: 33 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | | - | |
89 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
90 | 100 | | |
91 | 101 | | |
92 | 102 | | |
| |||
990 | 1000 | | |
991 | 1001 | | |
992 | 1002 | | |
| 1003 | + | |
993 | 1004 | | |
994 | 1005 | | |
995 | 1006 | | |
| |||
1164 | 1175 | | |
1165 | 1176 | | |
1166 | 1177 | | |
1167 | | - | |
1168 | | - | |
| 1178 | + | |
| 1179 | + | |
1169 | 1180 | | |
1170 | 1181 | | |
1171 | 1182 | | |
| |||
1512 | 1523 | | |
1513 | 1524 | | |
1514 | 1525 | | |
1515 | | - | |
1516 | | - | |
| 1526 | + | |
| 1527 | + | |
1517 | 1528 | | |
1518 | 1529 | | |
1519 | 1530 | | |
| |||
2106 | 2117 | | |
2107 | 2118 | | |
2108 | 2119 | | |
2109 | | - | |
2110 | | - | |
| 2120 | + | |
| 2121 | + | |
2111 | 2122 | | |
2112 | 2123 | | |
2113 | 2124 | | |
| |||
2726 | 2737 | | |
2727 | 2738 | | |
2728 | 2739 | | |
2729 | | - | |
2730 | | - | |
2731 | | - | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
2732 | 2747 | | |
2733 | 2748 | | |
2734 | 2749 | | |
| |||
2848 | 2863 | | |
2849 | 2864 | | |
2850 | 2865 | | |
| 2866 | + | |
| 2867 | + | |
2851 | 2868 | | |
2852 | 2869 | | |
2853 | 2870 | | |
| |||
3141 | 3158 | | |
3142 | 3159 | | |
3143 | 3160 | | |
| 3161 | + | |
| 3162 | + | |
3144 | 3163 | | |
3145 | 3164 | | |
3146 | 3165 | | |
| |||
3885 | 3904 | | |
3886 | 3905 | | |
3887 | 3906 | | |
3888 | | - | |
3889 | | - | |
3890 | | - | |
| 3907 | + | |
| 3908 | + | |
3891 | 3909 | | |
3892 | | - | |
3893 | 3910 | | |
3894 | 3911 | | |
3895 | 3912 | | |
| |||
0 commit comments