From patchwork Thu Nov 1 17:37:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Khlebnikov X-Patchwork-Id: 10664377 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1E3CC1751 for ; Thu, 1 Nov 2018 17:37:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BC0F2C1C7 for ; Thu, 1 Nov 2018 17:37:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3A472C2BA; Thu, 1 Nov 2018 17:37:58 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 721242C1C7 for ; Thu, 1 Nov 2018 17:37:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 496496B0006; Thu, 1 Nov 2018 13:37:57 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 445396B0007; Thu, 1 Nov 2018 13:37:57 -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 336976B0008; Thu, 1 Nov 2018 13:37:57 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by kanga.kvack.org (Postfix) with ESMTP id B9A2A6B0006 for ; Thu, 1 Nov 2018 13:37:56 -0400 (EDT) Received: by mail-lf1-f69.google.com with SMTP id h69so2620565lfg.10 for ; Thu, 01 Nov 2018 10:37:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:dkim-signature:subject:from:to :date:message-id:user-agent:mime-version:content-transfer-encoding; bh=9NSKQD9TC6CWOvQJHMbTYziFeV12lZg9YoYRZ3Vv2jQ=; b=imR4TvcI/UvJEIDhrfvB8OUFxS4n5UaHrDNom5sjlVDpfUaIW7QjzUUAEAnnS4En6+ U/s+JCgDKHwUF1yVQSPfQEYNw9VHxxwaAPojCXctHRtIyiV0IG7xWNybBqLps/W3Li1z hpf+cVGTZnseFFSMyth2uIW9iN5PvhdCVR9CWaa2zHO5vcK72smbhDLFQK2aWboKOSV9 sQRNCm7fOVDEc0FWvt+v6aJq2VDeCPqVM9QEH+1MLftrfdRUELugDxXPIfbTCEA9mS5x MVK1TZCm2tby6N2nZ99WhfQdeV4EWhvz/hS4hXnJh25BJUdqB1OVRNJS/+ug9/1u3Qe2 ZwbQ== X-Gm-Message-State: AGRZ1gIzsW7mPkU1JgXDhszYDn8nArIRglfo1rdaivELs57x5IfQ/0Bq YtpB5JXgCjM3g3jKO0XfmwfIHfIf6PWQza3dS0yGjSNxRKPdahmC1H2jtqvvSFEWgPKuvV4HTl7 F5VYTBIEQucw0KvqkNyXYWZJesgk2k8Spzidim9k8pHsGGswFrgkE2+0nH4gDeRUqyg== X-Received: by 2002:a2e:20f:: with SMTP id 15-v6mr5401257ljc.141.1541093875941; Thu, 01 Nov 2018 10:37:55 -0700 (PDT) X-Google-Smtp-Source: AJdET5efwpS0+fWWzhCrao9J3dTJvHcciv3DpNvd0xRiqcGewyT3uSKZW/ze88M5MCyn+6GHWrSj X-Received: by 2002:a2e:20f:: with SMTP id 15-v6mr5401225ljc.141.1541093874941; Thu, 01 Nov 2018 10:37:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541093874; cv=none; d=google.com; s=arc-20160816; b=yct8f3mEMeSXh2jvaEmSiCPNIH8Y00RZnc4iKBGdr0NzSkslCoc2drIjFdzGITjSBs MW03Ifm3sAXFbz905OUKhAdovdN2p3PU89pw0B8eERQ80ZmtXiPyIqHc68ykgCzml4PD /76QYAWL8pxV5Z03Xgt5tIpGyJRXcRq9c5Ebn29z3tsTPcZewADrOGG1iA9MC4xBIPoA m4gatQE17ErFNREHlS2wWoys6X6/+WmpbQZB5OyizEo7mBhy2n+x1vCYRlzOS9JvJtFQ hXxb7J3Y1Y7af9Z5gkUW1wSLLVYx1tibr1yt+//kGRiVQX0jszqO4W0FdqUTUL2gwmJv Ahnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:user-agent:message-id:date :to:from:subject:dkim-signature:dkim-signature; bh=9NSKQD9TC6CWOvQJHMbTYziFeV12lZg9YoYRZ3Vv2jQ=; b=L+660zbxIcC37rNYm0iuxD9IZ1L+kubS8uVbdOMZwBZDH81pA9amuf+MtM0rhdkmQR EytoPxMwOBL+RrOik0sm+z4jErp3vS67Bduwe2vgWb81JHH2QICPdDdy1oTOFvBrUSAw mKu0rreJSCaBdXLC7Vuoie/sdF5hbjGgHRx1g+CdJLN4gghgW1iRLRdjye/gFljLwg6R E3rb4QFbwcnALjKjedhMurrKcuGHzeRF3XLuBDTh1mIkec7k4pxdxFRek/o/KW5onRDI GFlgESR9Nyba1qNYha6OV3zvNaBBWE9h+VNAb0y5qJENnboR+ijIA3ijq1u5uK8Hgjxg L7QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=cQ6nP1rq; dkim=pass header.i=@yandex-team.ru header.s=default header.b="YjQfs1/o"; spf=pass (google.com: domain of khlebnikov@yandex-team.ru designates 5.255.227.105 as permitted sender) smtp.mailfrom=khlebnikov@yandex-team.ru; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Received: from forwardcorp1j.cmail.yandex.net (forwardcorp1j.cmail.yandex.net. [5.255.227.105]) by mx.google.com with ESMTPS id i140-v6si26316206lfg.118.2018.11.01.10.37.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Nov 2018 10:37:54 -0700 (PDT) Received-SPF: pass (google.com: domain of khlebnikov@yandex-team.ru designates 5.255.227.105 as permitted sender) client-ip=5.255.227.105; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=cQ6nP1rq; dkim=pass header.i=@yandex-team.ru header.s=default header.b="YjQfs1/o"; spf=pass (google.com: domain of khlebnikov@yandex-team.ru designates 5.255.227.105 as permitted sender) smtp.mailfrom=khlebnikov@yandex-team.ru; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Received: from mxbackcorp1o.mail.yandex.net (mxbackcorp1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::301]) by forwardcorp1j.cmail.yandex.net (Yandex) with ESMTP id 3CDF92115A; Thu, 1 Nov 2018 20:37:54 +0300 (MSK) Received: from smtpcorp1p.mail.yandex.net (smtpcorp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:10]) by mxbackcorp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 9Eetnn9lym-br785SsF; Thu, 01 Nov 2018 20:37:54 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1541093874; bh=9NSKQD9TC6CWOvQJHMbTYziFeV12lZg9YoYRZ3Vv2jQ=; h=Subject:From:To:Date:Message-ID; b=cQ6nP1rqfCJuNrTHvm5j/it7y/lCJV9JrOxuiHnaMCWsbhlrr+VejkxJ5S/0nDbvs V0FGi5LWm46kPtrQvlWTxsT/GScMIDXY6x/IWWVozKjlVAsiB17F2LHoAUmjchpYRC 2ocHJrX0ZYmui+oCLVvHRZlXfxjNBIanM77f7gsQ= Received: from dynamic-red.dhcp.yndx.net (dynamic-red.dhcp.yndx.net [2a02:6b8:0:40c:2501:1cc0:44e4:e39a]) by smtpcorp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2bn0JepsrD-brJ8svCg; Thu, 01 Nov 2018 20:37:53 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1541093873; bh=9NSKQD9TC6CWOvQJHMbTYziFeV12lZg9YoYRZ3Vv2jQ=; h=Subject:From:To:Date:Message-ID; b=YjQfs1/oojFxHwS1lXBorLFoxTAGLzobHNmKCP/+F440FQQq2Jpj6j5fk8UX/+CyH wFP4++cZNNp7Fxtecq/HagLwBnbYcIjni+T2HkTBS/OOzIo1bxdOSqty+xIKEJPz+h 9lvSL9inm3MHqUTUa737CDN2P9nDPbDWLssisC6M= Authentication-Results: smtpcorp1p.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Subject: [PATCH RFC] mm: do not start node_reclaim for page order > MAX_ORDER From: Konstantin Khlebnikov To: linux-mm@kvack.org, Andrew Morton , Michal Hocko , linux-kernel@vger.kernel.org Date: Thu, 01 Nov 2018 20:37:52 +0300 Message-ID: <154109387197.925352.10499549042420271600.stgit@buzz> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 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 Page allocator has check in __alloc_pages_slowpath() but nowdays there is earlier entry point into reclimer without such check: get_page_from_freelist() -> node_reclaim(). Signed-off-by: Konstantin Khlebnikov --- mm/vmscan.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/vmscan.c b/mm/vmscan.c index 62ac0c488624..52f672420f0b 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4117,6 +4117,12 @@ int node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned int order) { int ret; + /* + * Do not scan if allocation will never succeed. + */ + if (order >= MAX_ORDER) + return NODE_RECLAIM_NOSCAN; + /* * Node reclaim reclaims unmapped file backed pages and * slab pages if we are over the defined limits.