Commit ccac8e8
cgroup/cpuset: Fix remote root partition creation problem
Since commit 181c8e0 ("cgroup/cpuset: Introduce remote partition"),
a remote partition can be created underneath a non-partition root cpuset
as long as its exclusive_cpus are set to distribute exclusive CPUs down
to its children. The generate_sched_domains() function, however, doesn't
take into account this new behavior and hence will fail to create the
sched domain needed for a remote root (non-isolated) partition.
There are two issues related to remote partition support. First of
all, generate_sched_domains() has a fast path that is activated if
root_load_balance is true and top_cpuset.nr_subparts is non-zero. The
later condition isn't quite correct for remote partitions as nr_subparts
just shows the number of local child partitions underneath it. There
can be no local child partition under top_cpuset even if there are
remote partitions further down the hierarchy. Fix that by checking
for subpartitions_cpus which contains exclusive CPUs allocated to both
local and remote partitions.
Secondly, the valid partition check for subtree skipping in the csa[]
generation loop isn't enough as remote partition does not need to
have a partition root parent. Fix this problem by breaking csa[] array
generation loop of generate_sched_domains() into v1 and v2 specific parts
and checking a cpuset's exclusive_cpus before skipping its subtree in
the v2 case.
Also simplify generate_sched_domains() for cgroup v2 as only
non-isolating partition roots should be included in building the cpuset
array and none of the v1 scheduling attributes other than a different
way to create an isolated partition are supported.
Fixes: 181c8e0 ("cgroup/cpuset: Introduce remote partition")
Signed-off-by: Waiman Long <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>1 parent 6fe9601 commit ccac8e8
1 file changed
+42
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| |||
957 | 957 | | |
958 | 958 | | |
959 | 959 | | |
| 960 | + | |
960 | 961 | | |
961 | 962 | | |
962 | 963 | | |
963 | 964 | | |
964 | 965 | | |
965 | 966 | | |
966 | | - | |
| 967 | + | |
967 | 968 | | |
968 | 969 | | |
969 | 970 | | |
| |||
992 | 993 | | |
993 | 994 | | |
994 | 995 | | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
995 | 1000 | | |
| 1001 | + | |
996 | 1002 | | |
997 | 1003 | | |
998 | 1004 | | |
999 | 1005 | | |
1000 | 1006 | | |
1001 | 1007 | | |
1002 | | - | |
1003 | | - | |
1004 | | - | |
1005 | 1008 | | |
1006 | 1009 | | |
1007 | 1010 | | |
1008 | 1011 | | |
1009 | 1012 | | |
1010 | 1013 | | |
1011 | 1014 | | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
1015 | | - | |
1016 | 1015 | | |
1017 | 1016 | | |
1018 | 1017 | | |
1019 | 1018 | | |
1020 | | - | |
1021 | | - | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
1022 | 1037 | | |
1023 | 1038 | | |
1024 | 1039 | | |
| |||
1072 | 1087 | | |
1073 | 1088 | | |
1074 | 1089 | | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
1075 | 1104 | | |
1076 | 1105 | | |
1077 | 1106 | | |
| |||
1231 | 1260 | | |
1232 | 1261 | | |
1233 | 1262 | | |
1234 | | - | |
| 1263 | + | |
1235 | 1264 | | |
1236 | 1265 | | |
1237 | 1266 | | |
| |||
4575 | 4604 | | |
4576 | 4605 | | |
4577 | 4606 | | |
4578 | | - | |
| 4607 | + | |
4579 | 4608 | | |
4580 | 4609 | | |
4581 | 4610 | | |
| |||
0 commit comments