From 0080a8fa9501604a7324872534728b7b72481e37 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Thu, 28 Dec 2017 22:56:30 +0000 Subject: [PATCH] In vm_swapout_map_deactivate_pages(), it is enough to lock the map for read. Reviewed by: alc, markj (as part of the larger patch) Tested by: pho (again, as part of the larger patch) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13671 --- sys/vm/vm_swapout.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/vm/vm_swapout.c b/sys/vm/vm_swapout.c index e3e8b8966d76..2e067859ccda 100644 --- a/sys/vm/vm_swapout.c +++ b/sys/vm/vm_swapout.c @@ -263,7 +263,7 @@ vm_swapout_map_deactivate_pages(vm_map_t map, long desired) vm_object_t obj, bigobj; int nothingwired; - if (!vm_map_trylock(map)) + if (!vm_map_trylock_read(map)) return; bigobj = NULL; @@ -327,7 +327,7 @@ vm_swapout_map_deactivate_pages(vm_map_t map, long desired) vm_map_max(map)); } - vm_map_unlock(map); + vm_map_unlock_read(map); } /*