Repository navigation
Commit 734d451
cpuset: update cs->effective_{cpus, mems} when config changes
We're going to have separate user-configured masks and effective ones.
Eventually configured masks can only be changed by writing cpuset.cpus
and cpuset.mems, and they won't be restricted by parent cpuset. While
effective masks reflect cpu/memory hotplug and hierachical restriction,
and these are the real masks that apply to the tasks in the cpuset.
We calculate effective mask this way:
- top cpuset's effective_mask == online_mask, otherwise
- cpuset's effective_mask == configured_mask & parent effective_mask,
if the result is empty, it inherits parent effective mask.
Those behavior changes are for default hierarchy only. For legacy
hierarchy, effective_mask and configured_mask are the same, so we won't
break old interfaces.
To make cs->effective_{cpus,mems} to be effective masks, we need to
- update the effective masks at hotplug
- update the effective masks at config change
- take on ancestor's mask when the effective mask is empty
The second item is done here. We don't need to treat root_cs specially
in update_cpumasks_hier().
This won't introduce behavior change.
v3:
- add a WARN_ON() to check if effective masks are the same with configured
masks on legacy hierarchy.
- pass trialcs->cpus_allowed to update_cpumasks_hier() and add a comment for
it. Similar change for update_nodemasks_hier(). Suggested by Tejun.
v2:
- revise the comment in update_{cpu,node}masks_hier(), suggested by Tejun.
- fix to use @cp instead of @cs in these two functions.
Signed-off-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>1 parent 1344ab9 commit 734d451
1 file changed
Lines changed: 54 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
855 | 855 | | |
856 | 856 | | |
857 | 857 | | |
858 | | - | |
859 | | - | |
860 | | - | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
861 | 864 | | |
862 | | - | |
863 | | - | |
| 865 | + | |
864 | 866 | | |
865 | 867 | | |
866 | 868 | | |
867 | | - | |
| 869 | + | |
868 | 870 | | |
869 | 871 | | |
870 | 872 | | |
871 | 873 | | |
872 | 874 | | |
873 | | - | |
874 | | - | |
875 | | - | |
876 | | - | |
877 | | - | |
878 | | - | |
879 | | - | |
880 | | - | |
881 | | - | |
882 | | - | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
883 | 884 | | |
| 885 | + | |
884 | 886 | | |
885 | 887 | | |
886 | 888 | | |
887 | 889 | | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
888 | 897 | | |
889 | 898 | | |
890 | 899 | | |
| |||
940 | 949 | | |
941 | 950 | | |
942 | 951 | | |
943 | | - | |
| 952 | + | |
| 953 | + | |
944 | 954 | | |
945 | 955 | | |
946 | 956 | | |
| |||
1091 | 1101 | | |
1092 | 1102 | | |
1093 | 1103 | | |
1094 | | - | |
1095 | | - | |
1096 | | - | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
1097 | 1110 | | |
1098 | | - | |
1099 | | - | |
| 1111 | + | |
1100 | 1112 | | |
1101 | 1113 | | |
1102 | 1114 | | |
1103 | | - | |
| 1115 | + | |
1104 | 1116 | | |
1105 | 1117 | | |
1106 | 1118 | | |
1107 | 1119 | | |
1108 | 1120 | | |
1109 | | - | |
1110 | | - | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
1118 | | - | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
1119 | 1130 | | |
| 1131 | + | |
1120 | 1132 | | |
1121 | 1133 | | |
1122 | 1134 | | |
1123 | 1135 | | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
1124 | 1143 | | |
1125 | 1144 | | |
1126 | 1145 | | |
| |||
1188 | 1207 | | |
1189 | 1208 | | |
1190 | 1209 | | |
1191 | | - | |
| 1210 | + | |
| 1211 | + | |
1192 | 1212 | | |
1193 | 1213 | | |
1194 | 1214 | | |
| |||
0 commit comments