Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2 Drop take the {ttm, gem} vmobjlock in t...
details: https://anonhg.NetBSD.org/src/rev/f6b535b22e66
branches: trunk
changeset: 331702:f6b535b22e66
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Aug 20 13:48:08 2014 +0000
description:
Drop take the {ttm,gem} vmobjlock in the fault handler.
- We don't need this lock.
- uvm does nothing between taking it and calling the fault handler.
- Now that the uvm_aobj shares vmobjlock with the {ttm,gem} uvm
object, we must not hold the lock when we call uvm_obj_wirepages on
the uvm_aobj.
XXX pullup to netbsd-7
diffstat:
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c | 4 ++++
sys/external/bsd/drm2/ttm/ttm_bo_vm.c | 10 +++++++---
2 files changed, 11 insertions(+), 3 deletions(-)
diffs (59 lines):
diff -r 7485c0e76686 -r f6b535b22e66 sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c Wed Aug 20 13:29:07 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c Wed Aug 20 13:48:08 2014 +0000
@@ -1842,6 +1842,9 @@
intel_runtime_pm_get(dev_priv);
+ /* Thanks, uvm, but we don't need this lock. */
+ mutex_exit(uobj->vmobjlock);
+
ret = i915_mutex_lock_interruptible(dev);
if (ret)
goto out;
@@ -1880,6 +1883,7 @@
unlock:
mutex_unlock(&dev->struct_mutex);
out:
+ mutex_enter(uobj->vmobjlock);
uvmfault_unlockall(ufi, ufi->entry->aref.ar_amap, uobj);
if (ret == -ERESTART)
uvm_wait("i915flt");
diff -r 7485c0e76686 -r f6b535b22e66 sys/external/bsd/drm2/ttm/ttm_bo_vm.c
--- a/sys/external/bsd/drm2/ttm/ttm_bo_vm.c Wed Aug 20 13:29:07 2014 +0000
+++ b/sys/external/bsd/drm2/ttm/ttm_bo_vm.c Wed Aug 20 13:48:08 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ttm_bo_vm.c,v 1.3 2014/08/18 01:17:34 riastradh Exp $ */
+/* $NetBSD: ttm_bo_vm.c,v 1.4 2014/08/20 13:48:08 riastradh Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ttm_bo_vm.c,v 1.3 2014/08/18 01:17:34 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttm_bo_vm.c,v 1.4 2014/08/20 13:48:08 riastradh Exp $");
#include <sys/types.h>
@@ -92,6 +92,9 @@
unsigned mmapflags;
int ret;
+ /* Thanks, uvm, but we don't need this lock. */
+ mutex_exit(uobj->vmobjlock);
+
/* Copy-on-write mappings make no sense for the graphics aperture. */
if (UVM_ET_ISCOPYONWRITE(ufi->entry)) {
ret = -EIO;
@@ -199,7 +202,8 @@
out3: pmap_update(ufi->orig_map->pmap);
out2: ttm_mem_io_unlock(man);
out1: ttm_bo_unreserve(bo);
-out0: uvmfault_unlockall(ufi, ufi->entry->aref.ar_amap, uobj);
+out0: mutex_enter(uobj->vmobjlock);
+ uvmfault_unlockall(ufi, ufi->entry->aref.ar_amap, uobj);
/* XXX errno Linux->NetBSD */
return -ret;
}
Home |
Main Index |
Thread Index |
Old Index