Commit 269d28a
feat: mm: install page in a discrete method
This patch refactors the `rt_page_install` function by delegating specific
operations to new helper functions. Besides, the contiguous page regions
are now separated to segments of fixed size. The goal is to improve the
overall code readability, enhance modularity, and ensure better handling
of page installation logic through clearer separation of concerns.
Changes:
- Introduced `_get_mpr_ready_n_install` to encapsulate memory preparation
and page installation logic.
- Added `_update_region_list` for updating the installed page registry.
- Defined `_PAGE_STRIPE` for optimized region processing.
- Modified `rt_page_install` to handle regions in smaller chunks using
helper functions for better maintainability.
- Improved locking mechanisms with `rt_spin_lock` for thread safety.
- Reduced code duplication and clarified shadow region calculations.
Signed-off-by: Shell <[email protected]>1 parent 9386411 commit 269d28a
1 file changed
+64
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1112 | 1112 | | |
1113 | 1113 | | |
1114 | 1114 | | |
1115 | | - | |
| 1115 | + | |
1116 | 1116 | | |
1117 | | - | |
| 1117 | + | |
1118 | 1118 | | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
1119 | 1124 | | |
1120 | 1125 | | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
1121 | 1163 | | |
1122 | 1164 | | |
1123 | 1165 | | |
1124 | | - | |
1125 | | - | |
1126 | | - | |
1127 | | - | |
1128 | | - | |
1129 | | - | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
1130 | 1171 | | |
1131 | | - | |
| 1172 | + | |
1132 | 1173 | | |
1133 | | - | |
1134 | | - | |
| 1174 | + | |
1135 | 1175 | | |
1136 | | - | |
| 1176 | + | |
1137 | 1177 | | |
1138 | | - | |
1139 | | - | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
1140 | 1181 | | |
1141 | | - | |
1142 | | - | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
1143 | 1191 | | |
1144 | 1192 | | |
1145 | 1193 | | |
| |||
0 commit comments