git: 39a7396f5d0c - main - vm_page: Tighten the object lock assertion in vm_page_invalid()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 05 Dec 2021 15:52:40 UTC
The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=39a7396f5d0c3eac4401229e1b24fb8b89efc862 commit 39a7396f5d0c3eac4401229e1b24fb8b89efc862 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2021-12-05 15:39:58 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2021-12-05 15:51:11 +0000 vm_page: Tighten the object lock assertion in vm_page_invalid() A page must not become invalid while vm_fault_soft_fast() is attempting to map unbusied pages for reading. Note that all callers hold the object write lock already, and vm_page_set_invalid() asserts the object write lock. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33250 --- sys/vm/vm_page.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 28eb95d9fb33..f14a9330556b 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -5332,7 +5332,7 @@ vm_page_invalid(vm_page_t m) { vm_page_assert_busied(m); - VM_OBJECT_ASSERT_LOCKED(m->object); + VM_OBJECT_ASSERT_WLOCKED(m->object); MPASS(!pmap_page_is_mapped(m)); if (vm_page_xbusied(m))