From a41ece084017f53d5e5709c2d7ce82368aef04b6 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Wed, 14 Dec 2016 23:34:25 +0000 Subject: [PATCH] Remove locking around accounting initialization of the default object. The object is not yet fully constructed and must not be available to other threads. This makes default_pager_alloc() almost identical to swap_pager_alloc_init(). Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/vm/default_pager.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/vm/default_pager.c b/sys/vm/default_pager.c index 7fc4f6c49e0..d08e5f54a31 100644 --- a/sys/vm/default_pager.c +++ b/sys/vm/default_pager.c @@ -85,10 +85,8 @@ default_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, object = vm_object_allocate(OBJT_DEFAULT, OFF_TO_IDX(round_page(offset + size))); if (cred != NULL) { - VM_OBJECT_WLOCK(object); object->cred = cred; object->charge = size; - VM_OBJECT_WUNLOCK(object); } return (object); }