From 2832c7177dd6af1156c0e4b366ad9fc90be6bf08 Mon Sep 17 00:00:00 2001 From: kib Date: Tue, 24 May 2016 10:16:03 +0000 Subject: [PATCH] Remove Giant around allocation of the swap pager with non-NULL handle. Existing issue of not protecting pager_object_list iteration in vm_pager_object_lookup() by sw_alloc_mtx is not affected by Giant removal. Reviewed by: alc Sponsored by: The FreeBSD Foundation --- sys/vm/swap_pager.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index db1a2c47bb65..6ab965b802e8 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -604,7 +604,6 @@ swap_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, pindex = OFF_TO_IDX(offset + PAGE_MASK + size); if (handle) { - mtx_lock(&Giant); /* * Reference existing named region or allocate new one. There * should not be a race here against swp_pager_meta_build() @@ -617,7 +616,6 @@ swap_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, if (cred != NULL) { if (!swap_reserve_by_cred(size, cred)) { sx_xunlock(&sw_alloc_sx); - mtx_unlock(&Giant); return (NULL); } crhold(cred); @@ -633,7 +631,6 @@ swap_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, VM_OBJECT_WUNLOCK(object); } sx_xunlock(&sw_alloc_sx); - mtx_unlock(&Giant); } else { if (cred != NULL) { if (!swap_reserve_by_cred(size, cred))