From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: [PATCH 48/48] page allocator: Tmp OOM deadlock w/a from Chris Date: Fri, 6 Dec 2013 14:12:21 -0800 Message-ID: <1386367941-7131-96-git-send-email-benjamin.widawsky@intel.com> References: <20131206215521.GA6922@bwidawsk.net> <1386367941-7131-1-git-send-email-benjamin.widawsky@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail.bwidawsk.net (bwidawsk.net [166.78.191.112]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C81AFB264 for ; Fri, 6 Dec 2013 14:18:56 -0800 (PST) In-Reply-To: <1386367941-7131-1-git-send-email-benjamin.widawsky@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Intel GFX Cc: Ben Widawsky , Ben Widawsky List-Id: intel-gfx@lists.freedesktop.org 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 Signed-off-by: Ben Widawsky --- 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