From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932088AbbCYGR7 (ORCPT ); Wed, 25 Mar 2015 02:17:59 -0400 Received: from gum.cmpxchg.org ([85.214.110.215]:50914 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752605AbbCYGRv (ORCPT ); Wed, 25 Mar 2015 02:17:51 -0400 From: Johannes Weiner To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Torvalds , Andrew Morton , Tetsuo Handa , Huang Ying , Andrea Arcangeli , Dave Chinner , Michal Hocko , "Theodore Ts'o" Subject: [patch 11/12] mm: page_alloc: do not lock up GFP_NOFS allocations upon OOM Date: Wed, 25 Mar 2015 02:17:15 -0400 Message-Id: <1427264236-17249-12-git-send-email-hannes@cmpxchg.org> X-Mailer: git-send-email 2.3.3 In-Reply-To: <1427264236-17249-1-git-send-email-hannes@cmpxchg.org> References: <1427264236-17249-1-git-send-email-hannes@cmpxchg.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org GFP_NOFS allocations are not allowed to invoke the OOM killer since their reclaim abilities are severely diminished. However, without the OOM killer available there is no hope of progress once the reclaimable pages have been exhausted. Don't risk hanging these allocations. Leave it to the allocation site to implement the fallback policy for failing allocations. Signed-off-by: Johannes Weiner --- mm/page_alloc.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 832ad1c7cd4f..9e45e97aa934 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2367,15 +2367,8 @@ __alloc_pages_may_oom(gfp_t gfp_mask, unsigned int order, int alloc_flags, if (ac->high_zoneidx < ZONE_NORMAL) goto out; /* The OOM killer does not compensate for IO-less reclaim */ - if (!(gfp_mask & __GFP_FS)) { - /* - * XXX: Page reclaim didn't yield anything, - * and the OOM killer can't be invoked, but - * keep looping as per tradition. - */ - *did_some_progress = 1; + if (!(gfp_mask & __GFP_FS)) goto out; - } if (pm_suspended_storage()) goto out; /* The OOM killer may not free memory on a specific node */ -- 2.3.3 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by kanga.kvack.org (Postfix) with ESMTP id 51D656B007D for ; Wed, 25 Mar 2015 02:17:52 -0400 (EDT) Received: by wibbg6 with SMTP id bg6so10614975wib.0 for ; Tue, 24 Mar 2015 23:17:52 -0700 (PDT) Received: from gum.cmpxchg.org (gum.cmpxchg.org. [85.214.110.215]) by mx.google.com with ESMTPS id gp8si20823346wib.20.2015.03.24.23.17.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Mar 2015 23:17:51 -0700 (PDT) From: Johannes Weiner Subject: [patch 11/12] mm: page_alloc: do not lock up GFP_NOFS allocations upon OOM Date: Wed, 25 Mar 2015 02:17:15 -0400 Message-Id: <1427264236-17249-12-git-send-email-hannes@cmpxchg.org> In-Reply-To: <1427264236-17249-1-git-send-email-hannes@cmpxchg.org> References: <1427264236-17249-1-git-send-email-hannes@cmpxchg.org> Sender: owner-linux-mm@kvack.org List-ID: To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Torvalds , Andrew Morton , Tetsuo Handa , Huang Ying , Andrea Arcangeli , Dave Chinner , Michal Hocko , Theodore Ts'o GFP_NOFS allocations are not allowed to invoke the OOM killer since their reclaim abilities are severely diminished. However, without the OOM killer available there is no hope of progress once the reclaimable pages have been exhausted. Don't risk hanging these allocations. Leave it to the allocation site to implement the fallback policy for failing allocations. Signed-off-by: Johannes Weiner --- mm/page_alloc.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 832ad1c7cd4f..9e45e97aa934 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2367,15 +2367,8 @@ __alloc_pages_may_oom(gfp_t gfp_mask, unsigned int order, int alloc_flags, if (ac->high_zoneidx < ZONE_NORMAL) goto out; /* The OOM killer does not compensate for IO-less reclaim */ - if (!(gfp_mask & __GFP_FS)) { - /* - * XXX: Page reclaim didn't yield anything, - * and the OOM killer can't be invoked, but - * keep looping as per tradition. - */ - *did_some_progress = 1; + if (!(gfp_mask & __GFP_FS)) goto out; - } if (pm_suspended_storage()) goto out; /* The OOM killer may not free memory on a specific node */ -- 2.3.3 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org