git: b0acc3f11ba3 - main - vm_pager: Optimize an assertion

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Mon, 15 Nov 2021 18:02:58 UTC
The branch main has been updated by markj:

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

commit b0acc3f11ba31f0aea8ca5ce2720b481dfa79d1b
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-11-15 16:33:30 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-11-15 18:01:30 +0000

    vm_pager: Optimize an assertion
    
    Obtained from:  jeff (object_concurrency patches)
    Reviewed by:    kib
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D32946
---
 sys/vm/vm_pager.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c
index 69f0a2dc2bbb..6a186156b616 100644
--- a/sys/vm/vm_pager.c
+++ b/sys/vm/vm_pager.c
@@ -338,12 +338,11 @@ vm_pager_get_pages(vm_object_t object, vm_page_t *m, int count, int *rbehind,
 		 * updated the array.
 		 */
 #ifdef INVARIANTS
-		VM_OBJECT_RLOCK(object);
-		KASSERT(m[i] == vm_page_lookup(object, pindex++),
+		KASSERT(m[i] == vm_page_relookup(object, pindex++),
 		    ("%s: mismatch page %p pindex %ju", __func__,
 		    m[i], (uintmax_t )pindex - 1));
-		VM_OBJECT_RUNLOCK(object);
 #endif
+
 		/*
 		 * Zero out partially filled data.
 		 */