File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -310,7 +310,16 @@ static inline void wake_throttle_isolated(pg_data_t *pgdat)
310
310
wake_up (wqh );
311
311
}
312
312
313
- vm_fault_t vmf_anon_prepare (struct vm_fault * vmf );
313
+ vm_fault_t __vmf_anon_prepare (struct vm_fault * vmf );
314
+ static inline vm_fault_t vmf_anon_prepare (struct vm_fault * vmf )
315
+ {
316
+ vm_fault_t ret = __vmf_anon_prepare (vmf );
317
+
318
+ if (unlikely (ret & VM_FAULT_RETRY ))
319
+ vma_end_read (vmf -> vma );
320
+ return ret ;
321
+ }
322
+
314
323
vm_fault_t do_swap_page (struct vm_fault * vmf );
315
324
void folio_rotate_reclaimable (struct folio * folio );
316
325
bool __folio_end_writeback (struct folio * folio );
Original file line number Diff line number Diff line change @@ -3259,7 +3259,7 @@ static inline vm_fault_t vmf_can_call_fault(const struct vm_fault *vmf)
3259
3259
}
3260
3260
3261
3261
/**
3262
- * vmf_anon_prepare - Prepare to handle an anonymous fault.
3262
+ * __vmf_anon_prepare - Prepare to handle an anonymous fault.
3263
3263
* @vmf: The vm_fault descriptor passed from the fault handler.
3264
3264
*
3265
3265
* When preparing to insert an anonymous page into a VMA from a
@@ -3273,18 +3273,16 @@ static inline vm_fault_t vmf_can_call_fault(const struct vm_fault *vmf)
3273
3273
* Return: 0 if fault handling can proceed. Any other value should be
3274
3274
* returned to the caller.
3275
3275
*/
3276
- vm_fault_t vmf_anon_prepare (struct vm_fault * vmf )
3276
+ vm_fault_t __vmf_anon_prepare (struct vm_fault * vmf )
3277
3277
{
3278
3278
struct vm_area_struct * vma = vmf -> vma ;
3279
3279
vm_fault_t ret = 0 ;
3280
3280
3281
3281
if (likely (vma -> anon_vma ))
3282
3282
return 0 ;
3283
3283
if (vmf -> flags & FAULT_FLAG_VMA_LOCK ) {
3284
- if (!mmap_read_trylock (vma -> vm_mm )) {
3285
- vma_end_read (vma );
3284
+ if (!mmap_read_trylock (vma -> vm_mm ))
3286
3285
return VM_FAULT_RETRY ;
3287
- }
3288
3286
}
3289
3287
if (__anon_vma_prepare (vma ))
3290
3288
ret = VM_FAULT_OOM ;
You can’t perform that action at this time.
0 commit comments