The branch stable/14 has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=d1cdb4a087e69e1515a855a928ced8a18f9b75f9

commit d1cdb4a087e69e1515a855a928ced8a18f9b75f9
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2025-08-05 15:46:56 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2025-10-13 00:23:46 +0000

    vm_fault: assert that first_m is xbusy
    
    (cherry picked from commit a38483fa2b3a26414d3409b12dd35ac406c44cea)
---
 sys/vm/vm_fault.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index f6e75629864e..aad112a652ed 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -1785,6 +1785,11 @@ found:
        /*
         * A valid page has been found and busied.  The object lock
         * must no longer be held if the page was busied.
+        *
+        * Regardless of the busy state of fs.m, fs.first_m is always
+        * exclusively busied after the first iteration of the loop
+        * calling vm_fault_object().  This is an ordering point for
+        * the parallel faults occuring in on the same page.
         */
        vm_page_assert_busied(fs.m);
        VM_OBJECT_ASSERT_UNLOCKED(fs.object);
@@ -1887,6 +1892,9 @@ found:
                (*fs.m_hold) = fs.m;
                vm_page_wire(fs.m);
        }
+
+       KASSERT(fs.first_object == fs.object || vm_page_xbusied(fs.first_m),
+           ("first_m must be xbusy"));
        if (vm_page_xbusied(fs.m))
                vm_page_xunbusy(fs.m);
        else

Reply via email to