From patchwork Wed Aug 5 09:51:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 6947571 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2E06D9F358 for ; Wed, 5 Aug 2015 09:57:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 36E2520384 for ; Wed, 5 Aug 2015 09:57:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 599132034A for ; Wed, 5 Aug 2015 09:57:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751944AbbHEJ4p (ORCPT ); Wed, 5 Aug 2015 05:56:45 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:37017 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752001AbbHEJvv (ORCPT ); Wed, 5 Aug 2015 05:51:51 -0400 Received: by wibhh20 with SMTP id hh20so15973760wib.0; Wed, 05 Aug 2015 02:51:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=edG/ajUi5z6wGsoqC0PdwvyNmtQEqyG2XmASWWM9aMY=; b=kcdwRkgIyGs9jf7YO0bqzpF/W33shED961SmrOj72dtkwbJ9IbH8ZTVxYdYuh3GMfB Y0aX4p/5FR5TQdtaEFhhrncvGb+nMHTkmLCkXgmjEhEu8dONX5CEqwo5TFgPrTwOOpN/ C45U5MA/N/p1hAQr7hN2aRuQdZ+t7+Eftx5km/WEoeJwztA2qssXDl7+se6uSGcNJqBQ njoLDHOXWTR/hsy5ZQXwL6+IDUotxAeZLGRQfuTIIm5fP67opvH0owOkAaLJGGZdUNct W2PENU9vezrlhcD8ywTmEu7H766ScsWf9c60J1tpgUTBSDsSKMCZsWvvoUii5XjhztHR SoaA== X-Received: by 10.180.100.74 with SMTP id ew10mr8805398wib.12.1438768310197; Wed, 05 Aug 2015 02:51:50 -0700 (PDT) Received: from tiehlicka.suse.cz (nat1.scz.suse.com. [213.151.88.250]) by smtp.gmail.com with ESMTPSA id yu4sm3229106wjc.43.2015.08.05.02.51.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 05 Aug 2015 02:51:49 -0700 (PDT) From: mhocko@kernel.org To: LKML Cc: , , Andrew Morton , Johannes Weiner , Tetsuo Handa , Dave Chinner , "Theodore Ts'o" , linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, Jan Kara , Michal Hocko Subject: [RFC 3/8] mm: page_alloc: do not lock up GFP_NOFS allocations upon OOM Date: Wed, 5 Aug 2015 11:51:19 +0200 Message-Id: <1438768284-30927-4-git-send-email-mhocko@kernel.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1438768284-30927-1-git-send-email-mhocko@kernel.org> References: <1438768284-30927-1-git-send-email-mhocko@kernel.org> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Weiner 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 Signed-off-by: Michal Hocko --- 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 ee69c338ca2a..024d45d51700 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2715,15 +2715,8 @@ __alloc_pages_may_oom(gfp_t gfp_mask, unsigned int order, 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 */