Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Dec 2016 23:34:26 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r310097 - head/sys/vm
Message-ID:  <201612142334.uBENYQm1076785@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Dec 14 23:34:25 2016
New Revision: 310097
URL: https://svnweb.freebsd.org/changeset/base/310097

Log:
  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

Modified:
  head/sys/vm/default_pager.c

Modified: head/sys/vm/default_pager.c
==============================================================================
--- head/sys/vm/default_pager.c	Wed Dec 14 22:49:20 2016	(r310096)
+++ head/sys/vm/default_pager.c	Wed Dec 14 23:34:25 2016	(r310097)
@@ -85,10 +85,8 @@ default_pager_alloc(void *handle, vm_oof
 	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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612142334.uBENYQm1076785>