vma.c (20831cd6f814eade5e2fffce41352d8e8de1e764) | vma.c (2f1c6611b0a89afcb8641471af5f223c9caa01e0) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-or-later 2 3/* 4 * VMA-specific functions. 5 */ 6 7#include "vma_internal.h" 8#include "vma.h" 9 | 1// SPDX-License-Identifier: GPL-2.0-or-later 2 3/* 4 * VMA-specific functions. 5 */ 6 7#include "vma_internal.h" 8#include "vma.h" 9 |
10/* 11 * If the vma has a ->close operation then the driver probably needs to release 12 * per-vma resources, so we don't attempt to merge those if the caller indicates 13 * the current vma may be removed as part of the merge. 14 */ 15static inline bool is_mergeable_vma(struct vm_area_struct *vma, 16 struct file *file, unsigned long vm_flags, 17 struct vm_userfaultfd_ctx vm_userfaultfd_ctx, 18 struct anon_vma_name *anon_name, bool may_remove_vma) | 10static inline bool is_mergeable_vma(struct vma_merge_struct *vmg, bool merge_next) |
19{ | 11{ |
12 struct vm_area_struct *vma = merge_next ? vmg->next : vmg->prev; |
|
20 /* | 13 /* |
14 * If the vma has a ->close operation then the driver probably needs to 15 * release per-vma resources, so we don't attempt to merge those if the 16 * caller indicates the current vma may be removed as part of the merge, 17 * which is the case if we are attempting to merge the next VMA into 18 * this one. 19 */ 20 bool may_remove_vma = merge_next; 21 22 /* |
|
21 * VM_SOFTDIRTY should not prevent from VMA merging, if we 22 * match the flags but dirty bit -- the caller should mark 23 * merged VMA as dirty. If dirty bit won't be excluded from 24 * comparison, we increase pressure on the memory system forcing 25 * the kernel to generate new VMAs when old one could be 26 * extended instead. 27 */ | 23 * VM_SOFTDIRTY should not prevent from VMA merging, if we 24 * match the flags but dirty bit -- the caller should mark 25 * merged VMA as dirty. If dirty bit won't be excluded from 26 * comparison, we increase pressure on the memory system forcing 27 * the kernel to generate new VMAs when old one could be 28 * extended instead. 29 */ |
28 if ((vma->vm_flags ^ vm_flags) & ~VM_SOFTDIRTY) | 30 if ((vma->vm_flags ^ vmg->flags) & ~VM_SOFTDIRTY) |
29 return false; | 31 return false; |
30 if (vma->vm_file != file) | 32 if (vma->vm_file != vmg->file) |
31 return false; 32 if (may_remove_vma && vma->vm_ops && vma->vm_ops->close) 33 return false; | 33 return false; 34 if (may_remove_vma && vma->vm_ops && vma->vm_ops->close) 35 return false; |
34 if (!is_mergeable_vm_userfaultfd_ctx(vma, vm_userfaultfd_ctx)) | 36 if (!is_mergeable_vm_userfaultfd_ctx(vma, vmg->uffd_ctx)) |
35 return false; | 37 return false; |
36 if (!anon_vma_name_eq(anon_vma_name(vma), anon_name)) | 38 if (!anon_vma_name_eq(anon_vma_name(vma), vmg->anon_name)) |
37 return false; 38 return true; 39} 40 41static inline bool is_mergeable_anon_vma(struct anon_vma *anon_vma1, 42 struct anon_vma *anon_vma2, struct vm_area_struct *vma) 43{ 44 /* --- 44 unchanged lines hidden (view full) --- 89 * 90 * We don't check here for the merged mmap wrapping around the end of pagecache 91 * indices (16TB on ia32) because do_mmap() does not permit mmap's which 92 * wrap, nor mmaps which cover the final page at index -1UL. 93 * 94 * We assume the vma may be removed as part of the merge. 95 */ 96bool | 39 return false; 40 return true; 41} 42 43static inline bool is_mergeable_anon_vma(struct anon_vma *anon_vma1, 44 struct anon_vma *anon_vma2, struct vm_area_struct *vma) 45{ 46 /* --- 44 unchanged lines hidden (view full) --- 91 * 92 * We don't check here for the merged mmap wrapping around the end of pagecache 93 * indices (16TB on ia32) because do_mmap() does not permit mmap's which 94 * wrap, nor mmaps which cover the final page at index -1UL. 95 * 96 * We assume the vma may be removed as part of the merge. 97 */ 98bool |
97can_vma_merge_before(struct vm_area_struct *vma, unsigned long vm_flags, 98 struct anon_vma *anon_vma, struct file *file, 99 pgoff_t vm_pgoff, struct vm_userfaultfd_ctx vm_userfaultfd_ctx, 100 struct anon_vma_name *anon_name) | 99can_vma_merge_before(struct vma_merge_struct *vmg) |
101{ | 100{ |
102 if (is_mergeable_vma(vma, file, vm_flags, vm_userfaultfd_ctx, anon_name, true) && 103 is_mergeable_anon_vma(anon_vma, vma->anon_vma, vma)) { 104 if (vma->vm_pgoff == vm_pgoff) | 101 pgoff_t pglen = PHYS_PFN(vmg->end - vmg->start); 102 103 if (is_mergeable_vma(vmg, /* merge_next = */ true) && 104 is_mergeable_anon_vma(vmg->anon_vma, vmg->next->anon_vma, vmg->next)) { 105 if (vmg->next->vm_pgoff == vmg->pgoff + pglen) |
105 return true; 106 } | 106 return true; 107 } |
108 |
|
107 return false; 108} 109 110/* 111 * Return true if we can merge this (vm_flags,anon_vma,file,vm_pgoff) 112 * beyond (at a higher virtual address and file offset than) the vma. 113 * 114 * We cannot merge two vmas if they have differently assigned (non-NULL) 115 * anon_vmas, nor if same anon_vma is assigned but offsets incompatible. 116 * 117 * We assume that vma is not removed as part of the merge. 118 */ | 109 return false; 110} 111 112/* 113 * Return true if we can merge this (vm_flags,anon_vma,file,vm_pgoff) 114 * beyond (at a higher virtual address and file offset than) the vma. 115 * 116 * We cannot merge two vmas if they have differently assigned (non-NULL) 117 * anon_vmas, nor if same anon_vma is assigned but offsets incompatible. 118 * 119 * We assume that vma is not removed as part of the merge. 120 */ |
119bool 120can_vma_merge_after(struct vm_area_struct *vma, unsigned long vm_flags, 121 struct anon_vma *anon_vma, struct file *file, 122 pgoff_t vm_pgoff, struct vm_userfaultfd_ctx vm_userfaultfd_ctx, 123 struct anon_vma_name *anon_name) | 121bool can_vma_merge_after(struct vma_merge_struct *vmg) |
124{ | 122{ |
125 if (is_mergeable_vma(vma, file, vm_flags, vm_userfaultfd_ctx, anon_name, false) && 126 is_mergeable_anon_vma(anon_vma, vma->anon_vma, vma)) { 127 pgoff_t vm_pglen; 128 129 vm_pglen = vma_pages(vma); 130 if (vma->vm_pgoff + vm_pglen == vm_pgoff) | 123 if (is_mergeable_vma(vmg, /* merge_next = */ false) && 124 is_mergeable_anon_vma(vmg->anon_vma, vmg->prev->anon_vma, vmg->prev)) { 125 if (vmg->prev->vm_pgoff + vma_pages(vmg->prev) == vmg->pgoff) |
131 return true; 132 } 133 return false; 134} 135 136/* 137 * Close a vm structure and free it. 138 */ --- 873 unchanged lines hidden (view full) --- 1012 * 1013 * In the code below: 1014 * PPPP is represented by *prev 1015 * CCCC is represented by *curr or not represented at all (NULL) 1016 * NNNN is represented by *next or not represented at all (NULL) 1017 * **** is not represented - it will be merged and the vma containing the 1018 * area is returned, or the function will return NULL 1019 */ | 126 return true; 127 } 128 return false; 129} 130 131/* 132 * Close a vm structure and free it. 133 */ --- 873 unchanged lines hidden (view full) --- 1007 * 1008 * In the code below: 1009 * PPPP is represented by *prev 1010 * CCCC is represented by *curr or not represented at all (NULL) 1011 * NNNN is represented by *next or not represented at all (NULL) 1012 * **** is not represented - it will be merged and the vma containing the 1013 * area is returned, or the function will return NULL 1014 */ |
1020static struct vm_area_struct 1021*vma_merge(struct vma_iterator *vmi, struct vm_area_struct *prev, 1022 struct vm_area_struct *src, unsigned long addr, unsigned long end, 1023 unsigned long vm_flags, pgoff_t pgoff, struct mempolicy *policy, 1024 struct vm_userfaultfd_ctx vm_userfaultfd_ctx, 1025 struct anon_vma_name *anon_name) | 1015static struct vm_area_struct *vma_merge(struct vma_merge_struct *vmg) |
1026{ | 1016{ |
1027 struct mm_struct *mm = src->vm_mm; 1028 struct anon_vma *anon_vma = src->anon_vma; 1029 struct file *file = src->vm_file; | 1017 struct mm_struct *mm = vmg->mm; 1018 struct vm_area_struct *prev = vmg->prev; |
1030 struct vm_area_struct *curr, *next, *res; 1031 struct vm_area_struct *vma, *adjust, *remove, *remove2; 1032 struct vm_area_struct *anon_dup = NULL; 1033 struct vma_prepare vp; 1034 pgoff_t vma_pgoff; 1035 int err = 0; 1036 bool merge_prev = false; 1037 bool merge_next = false; 1038 bool vma_expanded = false; | 1019 struct vm_area_struct *curr, *next, *res; 1020 struct vm_area_struct *vma, *adjust, *remove, *remove2; 1021 struct vm_area_struct *anon_dup = NULL; 1022 struct vma_prepare vp; 1023 pgoff_t vma_pgoff; 1024 int err = 0; 1025 bool merge_prev = false; 1026 bool merge_next = false; 1027 bool vma_expanded = false; |
1028 unsigned long addr = vmg->start; 1029 unsigned long end = vmg->end; |
|
1039 unsigned long vma_start = addr; 1040 unsigned long vma_end = end; | 1030 unsigned long vma_start = addr; 1031 unsigned long vma_end = end; |
1041 pgoff_t pglen = (end - addr) >> PAGE_SHIFT; | 1032 pgoff_t pglen = PHYS_PFN(end - addr); |
1042 long adj_start = 0; 1043 1044 /* 1045 * We later require that vma->vm_flags == vm_flags, 1046 * so this tests vma->vm_flags & VM_SPECIAL, too. 1047 */ | 1033 long adj_start = 0; 1034 1035 /* 1036 * We later require that vma->vm_flags == vm_flags, 1037 * so this tests vma->vm_flags & VM_SPECIAL, too. 1038 */ |
1048 if (vm_flags & VM_SPECIAL) | 1039 if (vmg->flags & VM_SPECIAL) |
1049 return NULL; 1050 1051 /* Does the input range span an existing VMA? (cases 5 - 8) */ 1052 curr = find_vma_intersection(mm, prev ? prev->vm_end : 0, end); 1053 1054 if (!curr || /* cases 1 - 4 */ 1055 end == curr->vm_end) /* cases 6 - 8, adjacent VMA */ | 1040 return NULL; 1041 1042 /* Does the input range span an existing VMA? (cases 5 - 8) */ 1043 curr = find_vma_intersection(mm, prev ? prev->vm_end : 0, end); 1044 1045 if (!curr || /* cases 1 - 4 */ 1046 end == curr->vm_end) /* cases 6 - 8, adjacent VMA */ |
1056 next = vma_lookup(mm, end); | 1047 next = vmg->next = vma_lookup(mm, end); |
1057 else | 1048 else |
1058 next = NULL; /* case 5 */ | 1049 next = vmg->next = NULL; /* case 5 */ |
1059 1060 if (prev) { 1061 vma_start = prev->vm_start; 1062 vma_pgoff = prev->vm_pgoff; 1063 1064 /* Can we merge the predecessor? */ | 1050 1051 if (prev) { 1052 vma_start = prev->vm_start; 1053 vma_pgoff = prev->vm_pgoff; 1054 1055 /* Can we merge the predecessor? */ |
1065 if (addr == prev->vm_end && mpol_equal(vma_policy(prev), policy) 1066 && can_vma_merge_after(prev, vm_flags, anon_vma, file, 1067 pgoff, vm_userfaultfd_ctx, anon_name)) { | 1056 if (addr == prev->vm_end && mpol_equal(vma_policy(prev), vmg->policy) 1057 && can_vma_merge_after(vmg)) { 1058 |
1068 merge_prev = true; | 1059 merge_prev = true; |
1069 vma_prev(vmi); | 1060 vma_prev(vmg->vmi); |
1070 } 1071 } 1072 1073 /* Can we merge the successor? */ | 1061 } 1062 } 1063 1064 /* Can we merge the successor? */ |
1074 if (next && mpol_equal(policy, vma_policy(next)) && 1075 can_vma_merge_before(next, vm_flags, anon_vma, file, pgoff+pglen, 1076 vm_userfaultfd_ctx, anon_name)) { | 1065 if (next && mpol_equal(vmg->policy, vma_policy(next)) && 1066 can_vma_merge_before(vmg)) { |
1077 merge_next = true; 1078 } 1079 1080 /* Verify some invariant that must be enforced by the caller. */ 1081 VM_WARN_ON(prev && addr <= prev->vm_start); 1082 VM_WARN_ON(curr && (addr != curr->vm_start || end > curr->vm_end)); 1083 VM_WARN_ON(addr >= end); 1084 --- 74 unchanged lines hidden (view full) --- 1159 /* Error in anon_vma clone. */ 1160 if (err) 1161 goto anon_vma_fail; 1162 1163 if (vma_start < vma->vm_start || vma_end > vma->vm_end) 1164 vma_expanded = true; 1165 1166 if (vma_expanded) { | 1067 merge_next = true; 1068 } 1069 1070 /* Verify some invariant that must be enforced by the caller. */ 1071 VM_WARN_ON(prev && addr <= prev->vm_start); 1072 VM_WARN_ON(curr && (addr != curr->vm_start || end > curr->vm_end)); 1073 VM_WARN_ON(addr >= end); 1074 --- 74 unchanged lines hidden (view full) --- 1149 /* Error in anon_vma clone. */ 1150 if (err) 1151 goto anon_vma_fail; 1152 1153 if (vma_start < vma->vm_start || vma_end > vma->vm_end) 1154 vma_expanded = true; 1155 1156 if (vma_expanded) { |
1167 vma_iter_config(vmi, vma_start, vma_end); | 1157 vma_iter_config(vmg->vmi, vma_start, vma_end); |
1168 } else { | 1158 } else { |
1169 vma_iter_config(vmi, adjust->vm_start + adj_start, | 1159 vma_iter_config(vmg->vmi, adjust->vm_start + adj_start, |
1170 adjust->vm_end); 1171 } 1172 | 1160 adjust->vm_end); 1161 } 1162 |
1173 if (vma_iter_prealloc(vmi, vma)) | 1163 if (vma_iter_prealloc(vmg->vmi, vma)) |
1174 goto prealloc_fail; 1175 1176 init_multi_vma_prep(&vp, vma, adjust, remove, remove2); 1177 VM_WARN_ON(vp.anon_vma && adjust && adjust->anon_vma && 1178 vp.anon_vma != adjust->anon_vma); 1179 1180 vma_prepare(&vp); 1181 vma_adjust_trans_huge(vma, vma_start, vma_end, adj_start); 1182 vma_set_range(vma, vma_start, vma_end, vma_pgoff); 1183 1184 if (vma_expanded) | 1164 goto prealloc_fail; 1165 1166 init_multi_vma_prep(&vp, vma, adjust, remove, remove2); 1167 VM_WARN_ON(vp.anon_vma && adjust && adjust->anon_vma && 1168 vp.anon_vma != adjust->anon_vma); 1169 1170 vma_prepare(&vp); 1171 vma_adjust_trans_huge(vma, vma_start, vma_end, adj_start); 1172 vma_set_range(vma, vma_start, vma_end, vma_pgoff); 1173 1174 if (vma_expanded) |
1185 vma_iter_store(vmi, vma); | 1175 vma_iter_store(vmg->vmi, vma); |
1186 1187 if (adj_start) { 1188 adjust->vm_start += adj_start; 1189 adjust->vm_pgoff += adj_start >> PAGE_SHIFT; 1190 if (adj_start < 0) { 1191 WARN_ON(vma_expanded); | 1176 1177 if (adj_start) { 1178 adjust->vm_start += adj_start; 1179 adjust->vm_pgoff += adj_start >> PAGE_SHIFT; 1180 if (adj_start < 0) { 1181 WARN_ON(vma_expanded); |
1192 vma_iter_store(vmi, next); | 1182 vma_iter_store(vmg->vmi, next); |
1193 } 1194 } 1195 | 1183 } 1184 } 1185 |
1196 vma_complete(&vp, vmi, mm); | 1186 vma_complete(&vp, vmg->vmi, mm); |
1197 validate_mm(mm); | 1187 validate_mm(mm); |
1198 khugepaged_enter_vma(res, vm_flags); | 1188 khugepaged_enter_vma(res, vmg->flags); |
1199 return res; 1200 1201prealloc_fail: 1202 if (anon_dup) 1203 unlink_anon_vmas(anon_dup); 1204 1205anon_vma_fail: | 1189 return res; 1190 1191prealloc_fail: 1192 if (anon_dup) 1193 unlink_anon_vmas(anon_dup); 1194 1195anon_vma_fail: |
1206 vma_iter_set(vmi, addr); 1207 vma_iter_load(vmi); | 1196 vma_iter_set(vmg->vmi, addr); 1197 vma_iter_load(vmg->vmi); |
1208 return NULL; 1209} 1210 1211/* 1212 * We are about to modify one or multiple of a VMA's flags, policy, userfaultfd 1213 * context and anonymous VMA name within the range [start, end). 1214 * 1215 * As a result, we might be able to merge the newly modified VMA range with an 1216 * adjacent VMA with identical properties. 1217 * 1218 * If no merge is possible and the range does not span the entirety of the VMA, 1219 * we then need to split the VMA to accommodate the change. 1220 * 1221 * The function returns either the merged VMA, the original VMA if a split was 1222 * required instead, or an error if the split failed. 1223 */ | 1198 return NULL; 1199} 1200 1201/* 1202 * We are about to modify one or multiple of a VMA's flags, policy, userfaultfd 1203 * context and anonymous VMA name within the range [start, end). 1204 * 1205 * As a result, we might be able to merge the newly modified VMA range with an 1206 * adjacent VMA with identical properties. 1207 * 1208 * If no merge is possible and the range does not span the entirety of the VMA, 1209 * we then need to split the VMA to accommodate the change. 1210 * 1211 * The function returns either the merged VMA, the original VMA if a split was 1212 * required instead, or an error if the split failed. 1213 */ |
1224struct vm_area_struct *vma_modify(struct vma_iterator *vmi, 1225 struct vm_area_struct *prev, 1226 struct vm_area_struct *vma, 1227 unsigned long start, unsigned long end, 1228 unsigned long vm_flags, 1229 struct mempolicy *policy, 1230 struct vm_userfaultfd_ctx uffd_ctx, 1231 struct anon_vma_name *anon_name) | 1214static struct vm_area_struct *vma_modify(struct vma_merge_struct *vmg) |
1232{ | 1215{ |
1233 pgoff_t pgoff = vma->vm_pgoff + ((start - vma->vm_start) >> PAGE_SHIFT); | 1216 struct vm_area_struct *vma = vmg->vma; |
1234 struct vm_area_struct *merged; 1235 | 1217 struct vm_area_struct *merged; 1218 |
1236 merged = vma_merge(vmi, prev, vma, start, end, vm_flags, 1237 pgoff, policy, uffd_ctx, anon_name); | 1219 /* First, try to merge. */ 1220 merged = vma_merge(vmg); |
1238 if (merged) 1239 return merged; 1240 | 1221 if (merged) 1222 return merged; 1223 |
1241 if (vma->vm_start < start) { 1242 int err = split_vma(vmi, vma, start, 1); | 1224 /* Split any preceding portion of the VMA. */ 1225 if (vma->vm_start < vmg->start) { 1226 int err = split_vma(vmg->vmi, vma, vmg->start, 1); |
1243 1244 if (err) 1245 return ERR_PTR(err); 1246 } 1247 | 1227 1228 if (err) 1229 return ERR_PTR(err); 1230 } 1231 |
1248 if (vma->vm_end > end) { 1249 int err = split_vma(vmi, vma, end, 0); | 1232 /* Split any trailing portion of the VMA. */ 1233 if (vma->vm_end > vmg->end) { 1234 int err = split_vma(vmg->vmi, vma, vmg->end, 0); |
1250 1251 if (err) 1252 return ERR_PTR(err); 1253 } 1254 1255 return vma; 1256} 1257 | 1235 1236 if (err) 1237 return ERR_PTR(err); 1238 } 1239 1240 return vma; 1241} 1242 |
1243struct vm_area_struct *vma_modify_flags( 1244 struct vma_iterator *vmi, struct vm_area_struct *prev, 1245 struct vm_area_struct *vma, unsigned long start, unsigned long end, 1246 unsigned long new_flags) 1247{ 1248 VMG_VMA_STATE(vmg, vmi, prev, vma, start, end); 1249 1250 vmg.flags = new_flags; 1251 1252 return vma_modify(&vmg); 1253} 1254 1255struct vm_area_struct 1256*vma_modify_flags_name(struct vma_iterator *vmi, 1257 struct vm_area_struct *prev, 1258 struct vm_area_struct *vma, 1259 unsigned long start, 1260 unsigned long end, 1261 unsigned long new_flags, 1262 struct anon_vma_name *new_name) 1263{ 1264 VMG_VMA_STATE(vmg, vmi, prev, vma, start, end); 1265 1266 vmg.flags = new_flags; 1267 vmg.anon_name = new_name; 1268 1269 return vma_modify(&vmg); 1270} 1271 1272struct vm_area_struct 1273*vma_modify_policy(struct vma_iterator *vmi, 1274 struct vm_area_struct *prev, 1275 struct vm_area_struct *vma, 1276 unsigned long start, unsigned long end, 1277 struct mempolicy *new_pol) 1278{ 1279 VMG_VMA_STATE(vmg, vmi, prev, vma, start, end); 1280 1281 vmg.policy = new_pol; 1282 1283 return vma_modify(&vmg); 1284} 1285 1286struct vm_area_struct 1287*vma_modify_flags_uffd(struct vma_iterator *vmi, 1288 struct vm_area_struct *prev, 1289 struct vm_area_struct *vma, 1290 unsigned long start, unsigned long end, 1291 unsigned long new_flags, 1292 struct vm_userfaultfd_ctx new_ctx) 1293{ 1294 VMG_VMA_STATE(vmg, vmi, prev, vma, start, end); 1295 1296 vmg.flags = new_flags; 1297 vmg.uffd_ctx = new_ctx; 1298 1299 return vma_modify(&vmg); 1300} 1301 |
|
1258/* 1259 * Attempt to merge a newly mapped VMA with those adjacent to it. The caller 1260 * must ensure that [start, end) does not overlap any existing VMA. 1261 */ 1262struct vm_area_struct 1263*vma_merge_new_vma(struct vma_iterator *vmi, struct vm_area_struct *prev, 1264 struct vm_area_struct *vma, unsigned long start, 1265 unsigned long end, pgoff_t pgoff) 1266{ | 1302/* 1303 * Attempt to merge a newly mapped VMA with those adjacent to it. The caller 1304 * must ensure that [start, end) does not overlap any existing VMA. 1305 */ 1306struct vm_area_struct 1307*vma_merge_new_vma(struct vma_iterator *vmi, struct vm_area_struct *prev, 1308 struct vm_area_struct *vma, unsigned long start, 1309 unsigned long end, pgoff_t pgoff) 1310{ |
1267 return vma_merge(vmi, prev, vma, start, end, vma->vm_flags, pgoff, 1268 vma_policy(vma), vma->vm_userfaultfd_ctx, anon_vma_name(vma)); | 1311 VMG_VMA_STATE(vmg, vmi, prev, vma, start, end); 1312 1313 vmg.pgoff = pgoff; 1314 1315 return vma_merge(&vmg); |
1269} 1270 1271/* 1272 * Expand vma by delta bytes, potentially merging with an immediately adjacent 1273 * VMA with identical properties. 1274 */ 1275struct vm_area_struct *vma_merge_extend(struct vma_iterator *vmi, 1276 struct vm_area_struct *vma, 1277 unsigned long delta) 1278{ | 1316} 1317 1318/* 1319 * Expand vma by delta bytes, potentially merging with an immediately adjacent 1320 * VMA with identical properties. 1321 */ 1322struct vm_area_struct *vma_merge_extend(struct vma_iterator *vmi, 1323 struct vm_area_struct *vma, 1324 unsigned long delta) 1325{ |
1279 pgoff_t pgoff = vma->vm_pgoff + vma_pages(vma); | 1326 VMG_VMA_STATE(vmg, vmi, vma, vma, vma->vm_end, vma->vm_end + delta); |
1280 1281 /* vma is specified as prev, so case 1 or 2 will apply. */ | 1327 1328 /* vma is specified as prev, so case 1 or 2 will apply. */ |
1282 return vma_merge(vmi, vma, vma, vma->vm_end, vma->vm_end + delta, 1283 vma->vm_flags, pgoff, vma_policy(vma), 1284 vma->vm_userfaultfd_ctx, anon_vma_name(vma)); | 1329 return vma_merge(&vmg); |
1285} 1286 1287void unlink_file_vma_batch_init(struct unlink_vma_file_batch *vb) 1288{ 1289 vb->count = 0; 1290} 1291 1292static void unlink_file_vma_batch_process(struct unlink_vma_file_batch *vb) --- 541 unchanged lines hidden --- | 1330} 1331 1332void unlink_file_vma_batch_init(struct unlink_vma_file_batch *vb) 1333{ 1334 vb->count = 0; 1335} 1336 1337static void unlink_file_vma_batch_process(struct unlink_vma_file_batch *vb) --- 541 unchanged lines hidden --- |