Message ID | 1386367941-7131-96-git-send-email-benjamin.widawsky@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
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; } }
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@chris-wilson.co.uk> Signed-off-by: Ben Widawsky <ben@bwidawsk.net> --- mm/page_alloc.c | 4 ++++ 1 file changed, 4 insertions(+)