Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Aug 2017 17:02:25 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r322971 - head/sys/vm
Message-ID:  <201708281702.v7SH2Pq4042853@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Mon Aug 28 17:02:25 2017
New Revision: 322971
URL: https://svnweb.freebsd.org/changeset/base/322971

Log:
  Update a couple vm_object lock assertions in the swap pager to reflect the
  new use of the vm_object's lock to synchronize updates to a radix trie
  mapping per-vm object page indices to on-disk swap blocks.
  
  Fix a typo in a nearby comment.
  
  Reviewed by:	kib, markj
  X-MFC with:	r322913
  Differential Revision:	https://reviews.freebsd.org/D12134

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==============================================================================
--- head/sys/vm/swap_pager.c	Mon Aug 28 16:55:43 2017	(r322970)
+++ head/sys/vm/swap_pager.c	Mon Aug 28 17:02:25 2017	(r322971)
@@ -1827,7 +1827,7 @@ swp_pager_meta_free(vm_object_t object, vm_pindex_t pi
 	int i;
 	bool empty;
 
-	VM_OBJECT_ASSERT_LOCKED(object);
+	VM_OBJECT_ASSERT_WLOCKED(object);
 	if (object->type != OBJT_SWAP || count == 0)
 		return;
 
@@ -1909,9 +1909,13 @@ swp_pager_meta_ctl(vm_object_t object, vm_pindex_t pin
 	daddr_t r1;
 	int i;
 
-	VM_OBJECT_ASSERT_LOCKED(object);
+	if ((flags & (SWM_FREE | SWM_POP)) != 0)
+		VM_OBJECT_ASSERT_WLOCKED(object);
+	else
+		VM_OBJECT_ASSERT_LOCKED(object);
+
 	/*
-	 * The meta data only exists of the object is OBJT_SWAP
+	 * The meta data only exists if the object is OBJT_SWAP
 	 * and even then might not be allocated yet.
 	 */
 	if (object->type != OBJT_SWAP)



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