summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-02-06 16:37:21 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-02-06 17:23:51 +0000
commit4b3b25f0be33d3af3ccecfb3193fc2d365445fdf (patch)
treee1e602bf6add263d6ff28dec8f0cc4ad824f6e69 /src
parentdaba1ae3e7f0532cc53d9a5178778dbaec203052 (diff)
sna: Flush our caches if we fail to mmap an object
The likely cause for a mmap failure is that we hold too many objects open or have exhausted our address space. In both cases, we need to trim our caches before continuing. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/kgem.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index ae7ca10e..af4f0a81 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -292,6 +292,11 @@ retry_gtt:
if (kgem_expire_cache(kgem))
goto retry_gtt;
+ if (kgem->need_expire) {
+ kgem_cleanup_cache(kgem);
+ goto retry_gtt;
+ }
+
return NULL;
}
@@ -304,6 +309,11 @@ retry_mmap:
if (__kgem_throttle_retire(kgem, 0))
goto retry_mmap;
+ if (kgem->need_expire) {
+ kgem_cleanup_cache(kgem);
+ goto retry_mmap;
+ }
+
ptr = NULL;
}
@@ -4559,6 +4569,11 @@ retry:
if (__kgem_throttle_retire(kgem, 0))
goto retry;
+ if (kgem->need_expire) {
+ kgem_cleanup_cache(kgem);
+ goto retry;
+ }
+
return NULL;
}
@@ -4594,6 +4609,11 @@ retry:
if (__kgem_throttle_retire(kgem, 0))
goto retry;
+ if (kgem->need_expire) {
+ kgem_cleanup_cache(kgem);
+ goto retry;
+ }
+
return NULL;
}