Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Jul 2013 16:44:38 +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: r253710 - head/sys/dev/drm2/ttm
Message-ID:  <201307271644.r6RGic5v049944@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sat Jul 27 16:44:37 2013
New Revision: 253710
URL: http://svnweb.freebsd.org/changeset/base/253710

Log:
  MFgem r251960: re-check the mgt device object for the requested page
  after the object was relocked.
  
  Tested by:	dumbbell
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/dev/drm2/ttm/ttm_bo_vm.c

Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c
==============================================================================
--- head/sys/dev/drm2/ttm/ttm_bo_vm.c	Sat Jul 27 16:42:29 2013	(r253709)
+++ head/sys/dev/drm2/ttm/ttm_bo_vm.c	Sat Jul 27 16:44:37 2013	(r253710)
@@ -102,7 +102,7 @@ ttm_bo_vm_fault(vm_object_t vm_obj, vm_o
 	struct ttm_buffer_object *bo = vm_obj->handle;
 	struct ttm_bo_device *bdev = bo->bdev;
 	struct ttm_tt *ttm = NULL;
-	vm_page_t m, oldm;
+	vm_page_t m, m1, oldm;
 	int ret;
 	int retval = VM_PAGER_OK;
 	struct ttm_mem_type_manager *man =
@@ -220,7 +220,14 @@ reserve:
 	}
 	m->valid = VM_PAGE_BITS_ALL;
 	*mres = m;
-	vm_page_insert(m, vm_obj, OFF_TO_IDX(offset));
+	m1 = vm_page_lookup(vm_obj, OFF_TO_IDX(offset));
+	if (m1 == NULL) {
+		vm_page_insert(m, vm_obj, OFF_TO_IDX(offset));
+	} else {
+		KASSERT(m == m1,
+		    ("inconsistent insert bo %p m %p m1 %p offset %jx",
+		    bo, m, m1, (uintmax_t)offset));
+	}
 	vm_page_busy(m);
 
 	if (oldm != NULL) {



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