Date: Thu, 27 Mar 2025 10:40:42 GMT From: Doug Moore <dougm@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 6d6c97fb72a7 - main - vm_fault: update pred lock acq in copy_entry Message-ID: <202503271040.52RAeg1v080191@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=6d6c97fb72a7dce85008cef891d093b24dcbb380 commit 6d6c97fb72a7dce85008cef891d093b24dcbb380 Author: Doug Moore <dougm@FreeBSD.org> AuthorDate: 2025-03-27 10:39:44 +0000 Commit: Doug Moore <dougm@FreeBSD.org> CommitDate: 2025-03-27 10:39:44 +0000 vm_fault: update pred lock acq in copy_entry In vm_fault_copy_entry, variable 'mpred' is invalided as the predecessor of the next page to be inserted when an allocation failure leads to lock release and reacquisition. Recompute it in that case. Reported by: markj Reviewed by: markj Fixes: vm_page: expose page_alloc_after 6b33d9dc46c2f1cbb9127377119 Differential Revision: https://reviews.freebsd.org/D49521 --- sys/vm/vm_fault.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index c97a7cd998df..2e254e255dce 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -2199,14 +2199,16 @@ again: /* * Allocate a page in the destination object. */ - dst_m = vm_page_alloc_after(dst_object, (src_object == - dst_object ? src_pindex : 0) + dst_pindex, + pindex = (src_object == dst_object ? src_pindex : 0) + + dst_pindex; + dst_m = vm_page_alloc_after(dst_object, pindex, VM_ALLOC_NORMAL, mpred); if (dst_m == NULL) { VM_OBJECT_WUNLOCK(dst_object); VM_OBJECT_RUNLOCK(object); vm_wait(dst_object); VM_OBJECT_WLOCK(dst_object); + mpred = vm_page_mpred(src_object, pindex); goto again; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202503271040.52RAeg1v080191>