[Intel-gfx] [PATCH 48/48] page allocator: Tmp OOM deadlock w/a from Chris

Ben Widawsky benjamin.widawsky at intel.com
Fri Dec 6 23:11:33 CET 2013


Deadlock with OOM lock, and struct_mutex where we invoke the OOM killer
while holding struct_mutex, and unsuccessfully try to kill (because
close requires struct_mutex) other processes using a lot of GEM memory.

Authored-by: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
---
 mm/page_alloc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 580a5f0..708c038 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2467,6 +2467,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
 	bool sync_migration = false;
 	bool deferred_compaction = false;
 	bool contended_compaction = false;
+	int retry = 5*HZ;
 
 	/*
 	 * In the slowpath, we sanity check order to avoid ever trying to
@@ -2619,6 +2620,9 @@ rebalance:
 					goto nopage;
 			}
 
+			if (!--retry)
+				goto nopage;
+
 			goto restart;
 		}
 	}
-- 
1.8.4.2




More information about the Intel-gfx mailing list