From patchwork Tue Jul 3 14:25:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tetsuo Handa X-Patchwork-Id: 10504181 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7868B6035E for ; Tue, 3 Jul 2018 14:26:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 688FC28A8E for ; Tue, 3 Jul 2018 14:26:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 58D6C28AC4; Tue, 3 Jul 2018 14:26:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C763E28A8E for ; Tue, 3 Jul 2018 14:26:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B27C26B026F; Tue, 3 Jul 2018 10:26:40 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id AAEBE6B0270; Tue, 3 Jul 2018 10:26:40 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 99F296B0271; Tue, 3 Jul 2018 10:26:40 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-it0-f69.google.com (mail-it0-f69.google.com [209.85.214.69]) by kanga.kvack.org (Postfix) with ESMTP id 721AD6B026F for ; Tue, 3 Jul 2018 10:26:40 -0400 (EDT) Received: by mail-it0-f69.google.com with SMTP id k13-v6so347905ite.5 for ; Tue, 03 Jul 2018 07:26:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=7tnI6NgvG+NvaYcNfEo3upXeXyZ4spljag7yEF10jJQ=; b=MktG2gWkikicSxjxoHlW+OlkJyHk7Dj/2u5V1IMovyfTCY4miadI3VAqHxyQisZlF4 YmdoT5t7Xhz52mzfwhqTq6IEyMai0HLRs2jD7Ch3nFMjTzNIRIK1RRJ3SgI9FWJ3Gi2u 6CJnpthMEjkFYmV8vuZfWVgJG27WcPxzLWDuL9LHt19wGFIpu5jM5jtt9KnHk2A6JTOo J2MKrT/ywM+nQ5VINW4k5j8LzVOmV3py4vboTmVuT1rL8VFjScVK8981v5KbNHGSt7F3 yPWRq7WsnXj6ldKLpNe8g6gBbM4q3ULTTW5i2iDVSOuf+PWrIlLIcF7wTHZVSLcTp4CN D8tA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of penguin-kernel@i-love.sakura.ne.jp designates 202.181.97.72 as permitted sender) smtp.mailfrom=penguin-kernel@i-love.sakura.ne.jp X-Gm-Message-State: APt69E2Lwq5Hp27gngVVHhIBlDh+pevHyXB0PBZpwsv/3r5QYUFSE7UW xcegSEVqzoANG78N7ciOiNLyYFfK/pEtKj3p7pujfmHyIrnJQWQMHoQGKTzyuHZSEkvIe7kpQnZ Ca6A3cxHfh8Vr7aWfnBiKbaLYb40EoFB8HLI2Rc8VPmAKS+QblH/aIeUSiygPArpZ6A== X-Received: by 2002:a02:8c94:: with SMTP id f20-v6mr892704jak.98.1530628000239; Tue, 03 Jul 2018 07:26:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdQh1uTW+KnzgNI4vnhcQdzYeVwSfjL9VoqKf/UFzyjFhoTx0V47moiraUSceF2bxrbrry/ X-Received: by 2002:a02:8c94:: with SMTP id f20-v6mr892665jak.98.1530627999556; Tue, 03 Jul 2018 07:26:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530627999; cv=none; d=google.com; s=arc-20160816; b=hHobSsOpQBuyDAcVOPssvQLcgA2HGft8gSZfTCN+qvO4nq3FnRUzj/FSUR43jQpJW+ 8hk5sVCc+tvBhWAuFH4p3y8707j+olTrbbjly50zmF1Tc3Y2xJm4CBE/Du0znTGOLxAa 2EpwIatFHtk+vaFKT+nzn6YAkDn7AdUr1Lde8M8ywrp9Lwaf+MZalT94/zi8t983ciA+ VgJ1bVjj9gA525gJiDK5eXfah3Rmz2avtU+qJ/PPirjb9nBP5fb9P846DmRq2Kc1Lavo 4jLHC3z4ncg89BDYQAX4IUL67tgrCS1ZsZO+LO+83vyG9GmceZftfMlGTOevsTYUqCNO NUiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=7tnI6NgvG+NvaYcNfEo3upXeXyZ4spljag7yEF10jJQ=; b=u5kRGgEJrO2XF4qW5srLAQCfAK1QBf/2bWN16mqIpr033tCH1OngoQ7lrzEBxA6lj4 f1nRVGpyiDtLJnCcPQxC33OoJVhr9Kp1X1lpT408L30+NXvwFSUMptLBPhcDomtVOwXD TMf3cPOjez5zjjHr454qlV2QY0Nb0zrVsAktZohim7BvEutPsdn2N1Ynf5Tp12X47yPn UiSg+bEL3WDAJPGEguS5Xu1CtI+JA6Pf8H5uj8TPgM6bEaHibKEfLAcoR7PGUAlUYSQz FArd8wWioEKjc/mnAjD1P3zgODgOU0leOLwlxkE8fBnNWHu3WPHEhC9Hf0g8DmaeBLKk Qatg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of penguin-kernel@i-love.sakura.ne.jp designates 202.181.97.72 as permitted sender) smtp.mailfrom=penguin-kernel@i-love.sakura.ne.jp Received: from www262.sakura.ne.jp (www262.sakura.ne.jp. [202.181.97.72]) by mx.google.com with ESMTPS id b1-v6si810680ioh.138.2018.07.03.07.26.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jul 2018 07:26:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of penguin-kernel@i-love.sakura.ne.jp designates 202.181.97.72 as permitted sender) client-ip=202.181.97.72; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of penguin-kernel@i-love.sakura.ne.jp designates 202.181.97.72 as permitted sender) smtp.mailfrom=penguin-kernel@i-love.sakura.ne.jp Received: from fsav402.sakura.ne.jp (fsav402.sakura.ne.jp [133.242.250.101]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id w63EPpJD063906; Tue, 3 Jul 2018 23:25:51 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav402.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav402.sakura.ne.jp); Tue, 03 Jul 2018 23:25:51 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav402.sakura.ne.jp) Received: from ccsecurity.localdomain (softbank126074194044.bbtec.net [126.74.194.44]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id w63EPbJ8063838 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 3 Jul 2018 23:25:51 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) From: Tetsuo Handa To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: torvalds@linux-foundation.org, Tetsuo Handa , David Rientjes , Johannes Weiner , Michal Hocko , Roman Gushchin , Tejun Heo , Vladimir Davydov Subject: [PATCH 4/8] mm,page_alloc: Make oom_reserves_allowed() even. Date: Tue, 3 Jul 2018 23:25:05 +0900 Message-Id: <1530627910-3415-5-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1530627910-3415-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> References: <1530627910-3415-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Since CONFIG_MMU=n kernels no longer waits for OOM victims forever, there is no possibiligty of OOM lockup. Therefore, we can get rid of special handling of oom_reserves_allowed(). Signed-off-by: Tetsuo Handa Cc: Roman Gushchin Cc: Michal Hocko Cc: Johannes Weiner Cc: Vladimir Davydov Cc: David Rientjes Cc: Tejun Heo --- mm/page_alloc.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 6205d34..b915533 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3862,21 +3862,6 @@ static void wake_all_kswapds(unsigned int order, gfp_t gfp_mask, return alloc_flags; } -static bool oom_reserves_allowed(struct task_struct *tsk) -{ - if (!tsk_is_oom_victim(tsk)) - return false; - - /* - * !MMU doesn't have oom reaper so give access to memory reserves - * only to the thread with TIF_MEMDIE set - */ - if (!IS_ENABLED(CONFIG_MMU) && !test_thread_flag(TIF_MEMDIE)) - return false; - - return true; -} - /* * Distinguish requests which really need access to full memory * reserves from oom victims which can live with a portion of it @@ -3892,7 +3877,7 @@ static inline int __gfp_pfmemalloc_flags(gfp_t gfp_mask) if (!in_interrupt()) { if (current->flags & PF_MEMALLOC) return ALLOC_NO_WATERMARKS; - else if (oom_reserves_allowed(current)) + else if (tsk_is_oom_victim(current)) return ALLOC_OOM; }