git: 1f88394b7f35 - main - vm_fault: Avoid unnecessary object relocking in vm_fault_copy_entry()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 14 Jun 2022 22:19:24 UTC
The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1f88394b7f35a50507b1faade9e8854f104b563d commit 1f88394b7f35a50507b1faade9e8854f104b563d Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2022-06-14 20:37:35 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2022-06-14 22:19:07 +0000 vm_fault: Avoid unnecessary object relocking in vm_fault_copy_entry() Suggested by: alc Reviewed by: alc, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D35485 --- sys/vm/vm_fault.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 3aca14777830..ba6f2ebfc730 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -2122,7 +2122,6 @@ again: break; } } - VM_OBJECT_WUNLOCK(dst_object); /* * Enter it in the pmap. If a wired, copy-on-write @@ -2137,15 +2136,15 @@ again: * backing pages. */ if (vm_page_all_valid(dst_m)) { + VM_OBJECT_WUNLOCK(dst_object); pmap_enter(dst_map->pmap, vaddr, dst_m, prot, access | (upgrade ? PMAP_ENTER_WIRED : 0), 0); + VM_OBJECT_WLOCK(dst_object); } /* * Mark it no longer busy, and put it on the active list. */ - VM_OBJECT_WLOCK(dst_object); - if (upgrade) { if (src_m != dst_m) { vm_page_unwire(src_m, PQ_INACTIVE);