summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorBen Widawsky <benjamin.widawsky@intel.com>2013-11-27 16:52:08 -0800
committerBen Widawsky <benjamin.widawsky@intel.com>2013-12-06 11:00:25 -0800
commit7eae4c845ee80ad2ade3461f0291b83edd1207d9 (patch)
treeca629665e4cadb2535e84301a11d4d49f9c9b2bf /mm
parent6cfcfaa6dcf40cc608f7c3cd1fd33fdf33d4be83 (diff)
page allocator: Tmp OOM deadlock w/a from ChrisHEADppgtt
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>
Diffstat (limited to 'mm')
-rw-r--r--mm/page_alloc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 580a5f075ed0..708c0382c931 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;
}
}