From owner-svn-src-user@FreeBSD.ORG Fri May 23 22:39:01 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3175E710; Fri, 23 May 2014 22:39:01 +0000 (UTC) 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04B762D37; Fri, 23 May 2014 22:39:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4NMd0t1093199; Fri, 23 May 2014 22:39:00 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4NMd0pZ093197; Fri, 23 May 2014 22:39:00 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201405232239.s4NMd0pZ093197@svn.freebsd.org> From: Attilio Rao Date: Fri, 23 May 2014 22:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r266599 - in user/attilio/rm_vmobj_cache/sys: dev/drm2/ttm x86/iommu X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 22:39:01 -0000 Author: attilio Date: Fri May 23 22:39:00 2014 New Revision: 266599 URL: http://svnweb.freebsd.org/changeset/base/266599 Log: Page allocated by vm_page_alloc_contig() are always unmanaged, then wire them. Modified: user/attilio/rm_vmobj_cache/sys/dev/drm2/ttm/ttm_bo.c user/attilio/rm_vmobj_cache/sys/x86/iommu/intel_utils.c Modified: user/attilio/rm_vmobj_cache/sys/dev/drm2/ttm/ttm_bo.c ============================================================================== --- user/attilio/rm_vmobj_cache/sys/dev/drm2/ttm/ttm_bo.c Fri May 23 21:24:31 2014 (r266598) +++ user/attilio/rm_vmobj_cache/sys/dev/drm2/ttm/ttm_bo.c Fri May 23 22:39:00 2014 (r266599) @@ -1472,6 +1472,7 @@ static void ttm_bo_global_kobj_release(s { ttm_mem_unregister_shrink(glob->mem_glob, &glob->shrink); + vm_page_unwire(glob->dummy_read_page, 0); vm_page_free(glob->dummy_read_page); } @@ -1494,7 +1495,7 @@ int ttm_bo_global_init(struct drm_global mtx_init(&glob->lru_lock, "ttmlru", NULL, MTX_DEF); glob->mem_glob = bo_ref->mem_glob; glob->dummy_read_page = vm_page_alloc_contig(NULL, 0, - VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ, + VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED, 1, 0, VM_MAX_ADDRESS, PAGE_SIZE, 0, VM_MEMATTR_UNCACHEABLE); if (unlikely(glob->dummy_read_page == NULL)) { @@ -1518,6 +1519,7 @@ int ttm_bo_global_init(struct drm_global return (0); out_no_shrink: + vm_page_unwire(glob->dummy_read_page, 0); vm_page_free(glob->dummy_read_page); out_no_drp: free(glob, M_DRM_GLOBAL); Modified: user/attilio/rm_vmobj_cache/sys/x86/iommu/intel_utils.c ============================================================================== --- user/attilio/rm_vmobj_cache/sys/x86/iommu/intel_utils.c Fri May 23 21:24:31 2014 (r266598) +++ user/attilio/rm_vmobj_cache/sys/x86/iommu/intel_utils.c Fri May 23 22:39:00 2014 (r266599) @@ -272,8 +272,8 @@ dmar_pgalloc(vm_object_t obj, vm_pindex_ break; } m = vm_page_alloc_contig(obj, idx, VM_ALLOC_NOBUSY | - VM_ALLOC_SYSTEM | VM_ALLOC_NODUMP | zeroed, 1, 0, - dmar_high, PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); + VM_ALLOC_SYSTEM | VM_ALLOC_NODUMP | VM_ALLOC_WIRED | + zeroed, 1, 0, dmar_high, PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); if ((flags & DMAR_PGF_OBJL) == 0) VM_OBJECT_WUNLOCK(obj); if (m != NULL) { @@ -302,6 +302,7 @@ dmar_pgfree(vm_object_t obj, vm_pindex_t VM_OBJECT_WLOCK(obj); m = vm_page_lookup(obj, idx); if (m != NULL) { + vm_page_unwire(m, 0); vm_page_free(m); atomic_subtract_int(&dmar_tbl_pagecnt, 1); }