From patchwork Tue Nov 13 08:04:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 10680029 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 002DF14E2 for ; Tue, 13 Nov 2018 08:04:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E63F22A450 for ; Tue, 13 Nov 2018 08:04:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D90FF2A462; Tue, 13 Nov 2018 08:04:55 +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,FREEMAIL_FROM,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 987AC2A450 for ; Tue, 13 Nov 2018 08:04:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BA8B06B026A; Tue, 13 Nov 2018 03:04:53 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B2F7D6B026B; Tue, 13 Nov 2018 03:04:53 -0500 (EST) 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 9D34A6B026C; Tue, 13 Nov 2018 03:04:53 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by kanga.kvack.org (Postfix) with ESMTP id 56CE76B026A for ; Tue, 13 Nov 2018 03:04:53 -0500 (EST) Received: by mail-pf1-f197.google.com with SMTP id z22-v6so9009084pfi.0 for ; Tue, 13 Nov 2018 00:04:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=ZxBwqXaiZNsWqLXFmyYSwz6qmfzCZo5KHnYwnsdMXYA=; b=WnzNznqIob0qvP4pmZ8DnWsr3Kda+cKZCpEcrlbXU6f23T4QgDdWxKJJ1rWvxjvPjJ A7PayPKUndBbjEbWlx5O5Yn2FHRatcetVSGmP62HTykL170VCX8bZrVISWgJqjBmPQEv wX0pk/OtfN20xqN5wRx+WQPmNKaefBgBGly7Zk2vyYVwac6WPeXSgtkU2MYj/ZGQ0Yn/ NeIBNUaJYzLlxY45SBj82e3puWErlEqi9OM8UyZGGo8V1IbwP38WyF7ZjYYjwY04vSe5 GMQ+WzrlRLcuRxEWuHsJi22tooB7/e7/yrlNVadhL5V7vgn+PE9HiuqL3sy9Nl6Ws/4Q HlIA== X-Gm-Message-State: AGRZ1gJgXZ0tpF/jUpY9KkVSOsqVA4ozFtQYgywXG49vzbfrObstrdU5 7FIELOEuHSWf5UHQqvy/Di8rjCZnTaGhn4YsqNJ10rjKhmUfYD75Q3iprpFREKLfeSEuQyvjSbn Awx6323jdrlnPr9mRIZ9iIZTucf3mNYaU5PicSNkD2mMjxzkzb4UvJjZPmvLGjsEXFU+mLdt4z/ F4wfa+1tfmB/27DOhksb3ZVGdUYIK61jkec5JbH336JKoOgFnDXcSGXCVCtJsl+P5PU38z78Co/ +wbRIpifrYQJENupLt/43cmnyDEfOXMwfEpfhelE8tLUQVkP5MYuANOMdJCyTpQqvyhAtD0XBh+ VR8nOcsVKoW+ed7mWIsbQdWbqZgnzBnldpeWYxzzwvKbVnxX0Mrjdap/RtBPoXru2C1ZE+JY041 g X-Received: by 2002:a63:d949:: with SMTP id e9mr3886417pgj.24.1542096292931; Tue, 13 Nov 2018 00:04:52 -0800 (PST) X-Received: by 2002:a63:d949:: with SMTP id e9mr3886379pgj.24.1542096292131; Tue, 13 Nov 2018 00:04:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542096292; cv=none; d=google.com; s=arc-20160816; b=SscWEwpoWsAIBs9k6a1sjLNEK9Ls3WoQ5zgizZ9kHnEigzkBu7O6FwJBjfkJZrqh6x Dbh8rHUQlF4uMUjCxjpjosptCVDj7mPRD0sxQUermV78kftXFxZPVCHiZpbh8bJiZ3JI ZlFTTUbNWBBY50ZxhBqXiovR89o1LWRfuXBft+hbDx6QSO6RGl68G6xRTy3AabRSxWpE CWlUFipPNvCGCJlyX1ZWtyXlv9M7BJiyoiA43euz0RAMqnGZZ/ahHBkXCFJo7He7twjI 4rwvEZVHNjyj+Xwtju5lhMyna4glcQiPxsmsdA40ciBCzasqwVA2/+6U3P/va4qLl6B+ Ojtg== 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 :dkim-signature; bh=ZxBwqXaiZNsWqLXFmyYSwz6qmfzCZo5KHnYwnsdMXYA=; b=aZexawU50UzDwBsT5NhIzIQe0LZ6se2uNujD1QqgFgc/0mA/nnPrBrG24p1GpBi4Dd kys5+28VhkrLdZrl28XJD8thpda7VDn+SSW+RzWtgAdhj7DeCNVoP6IMV3OICEo6Y+w2 ocYAmAvVCVjSjjryjtXFnDKEjc85Rwq2TdeRxY82nm9WMRox/kLS1yv+zFDgoVnXBiPd sIU/aSUq2sPtRxo8ecDQUZ3VJy/L9ra1PkSiw826LtCARreYASzXnrW7WikkZGPxMhru VY8IAKZznL5MRFBARP8oxCQBfUde+HRznSjpwqX8s7TAy+ihlFId/7ydLVaHmOzNWIDN QlaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=h8iXvyZu; spf=pass (google.com: domain of richard.weiyang@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id b23-v6sor14393473pls.11.2018.11.13.00.04.52 for (Google Transport Security); Tue, 13 Nov 2018 00:04:52 -0800 (PST) Received-SPF: pass (google.com: domain of richard.weiyang@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=h8iXvyZu; spf=pass (google.com: domain of richard.weiyang@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZxBwqXaiZNsWqLXFmyYSwz6qmfzCZo5KHnYwnsdMXYA=; b=h8iXvyZusPAzra+ritGfF4mXx0RNQgwKg/g46J4qLzA6hDTIbismyyr/AQbnHvdb12 u2aSq+oSX+51y+sc0FYagyoLSr5yNol5n7Jm4cyk1vcq9jC2nYUvMUJ9v4mRg7JMXY2J KfwMhJbQCZMRHdipyPVgcxazuJjPJOwhXPfJgGNplzaCK1pnYeCJqh7V2fOL0zRqKm0y xvIgdE1QC6js5T5/FGrbwl1Xr3nqxeyNKVsxbSVAKKByhu7d922sPKspurT5XVfQ3BKO borG8qlahvV8EV5OppFh0/ko0jLcIDT0dPJpP3UxajJdO6ZxgEe+am0HRspm41CVS9RW +q4A== X-Google-Smtp-Source: AJdET5cXu3qdnJkORIjfxLSzsZNDubW/Lq5xEtzNlYjml2akDkeUmbSWEHViTuJM2ytVWE7EIVd90g== X-Received: by 2002:a17:902:223:: with SMTP id 32-v6mr4113792plc.112.1542096291359; Tue, 13 Nov 2018 00:04:51 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 7-v6sm16766665pgk.31.2018.11.13.00.04.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 00:04:50 -0800 (PST) From: Wei Yang To: akpm@linux-foundation.org, mgorman@techsingularity.net Cc: willy@infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wei Yang Subject: [PATCH v2] vmscan: return NODE_RECLAIM_NOSCAN in node_reclaim() when CONFIG_NUMA is n Date: Tue, 13 Nov 2018 16:04:36 +0800 Message-Id: <20181113080436.22078-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20181113041750.20784-1-richard.weiyang@gmail.com> References: <20181113041750.20784-1-richard.weiyang@gmail.com> 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 Commit fa5e084e43eb ("vmscan: do not unconditionally treat zones that fail zone_reclaim() as full") changed the return value of node_reclaim(). The original return value 0 means NODE_RECLAIM_SOME after this commit. While the return value of node_reclaim() when CONFIG_NUMA is n is not changed. This will leads to call zone_watermark_ok() again. This patch fix the return value by adjusting to NODE_RECLAIM_NOSCAN. Since node_reclaim() is only called in page_alloc.c, move it to mm/internal.h. Signed-off-by: Wei Yang Acked-by: Michal Hocko Reviewed-by: Matthew Wilcox --- v2: move node_reclaim() to mm/internal.h --- include/linux/swap.h | 6 ------ mm/internal.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/linux/swap.h b/include/linux/swap.h index d8a07a4f171d..065988c27373 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -358,14 +358,8 @@ extern unsigned long vm_total_pages; extern int node_reclaim_mode; extern int sysctl_min_unmapped_ratio; extern int sysctl_min_slab_ratio; -extern int node_reclaim(struct pglist_data *, gfp_t, unsigned int); #else #define node_reclaim_mode 0 -static inline int node_reclaim(struct pglist_data *pgdat, gfp_t mask, - unsigned int order) -{ - return 0; -} #endif extern int page_evictable(struct page *page); diff --git a/mm/internal.h b/mm/internal.h index 291eb2b6d1d8..6a57811ae47d 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -444,6 +444,16 @@ static inline void mminit_validate_memmodel_limits(unsigned long *start_pfn, #define NODE_RECLAIM_SOME 0 #define NODE_RECLAIM_SUCCESS 1 +#ifdef CONFIG_NUMA +extern int node_reclaim(struct pglist_data *, gfp_t, unsigned int); +#else +static inline int node_reclaim(struct pglist_data *pgdat, gfp_t mask, + unsigned int order) +{ + return NODE_RECLAIM_NOSCAN; +} +#endif + extern int hwpoison_filter(struct page *p); extern u32 hwpoison_filter_dev_major;