From owner-svn-src-head@FreeBSD.ORG Sat Jul 27 16:44:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5C04A845; Sat, 27 Jul 2013 16:44:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 498E52C45; Sat, 27 Jul 2013 16:44:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6RGicBf049945; Sat, 27 Jul 2013 16:44:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6RGic5v049944; Sat, 27 Jul 2013 16:44:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307271644.r6RGic5v049944@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 27 Jul 2013 16:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253710 - head/sys/dev/drm2/ttm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jul 2013 16:44:38 -0000 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) {