From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95AD1C35E03 for ; Tue, 25 Feb 2020 14:15:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6539D218AC for ; Tue, 25 Feb 2020 14:15:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6539D218AC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=techsingularity.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 66F626B000D; Tue, 25 Feb 2020 09:15:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5D1BB6B000C; Tue, 25 Feb 2020 09:15:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 498A06B000A; Tue, 25 Feb 2020 09:15:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0188.hostedemail.com [216.40.44.188]) by kanga.kvack.org (Postfix) with ESMTP id 300BD6B0007 for ; Tue, 25 Feb 2020 09:15:40 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 97058181AC9CB for ; Tue, 25 Feb 2020 14:15:39 +0000 (UTC) X-FDA: 76528847598.14.mass21_1427b0ba8573f X-HE-Tag: mass21_1427b0ba8573f X-Filterd-Recvd-Size: 3225 Received: from outbound-smtp51.blacknight.com (outbound-smtp51.blacknight.com [46.22.136.235]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Tue, 25 Feb 2020 14:15:37 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp51.blacknight.com (Postfix) with ESMTPS id 61FC0FA7CF for ; Tue, 25 Feb 2020 14:15:36 +0000 (GMT) Received: (qmail 1897 invoked from network); 25 Feb 2020 14:15:36 -0000 Received: from unknown (HELO stampy.112glenside.lan) (mgorman@techsingularity.net@[84.203.18.57]) by 81.17.254.9 with ESMTPA; 25 Feb 2020 14:15:36 -0000 From: Mel Gorman To: Andrew Morton Cc: Michal Hocko , Vlastimil Babka , Ivan Babrou , Rik van Riel , Linux-MM , Linux Kernel Mailing List , Mel Gorman Subject: [PATCH 1/3] mm, page_alloc: Disable boosted watermark based reclaim on low-memory systems Date: Tue, 25 Feb 2020 14:15:32 +0000 Message-Id: <20200225141534.5044-2-mgorman@techsingularity.net> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200225141534.5044-1-mgorman@techsingularity.net> References: <20200225141534.5044-1-mgorman@techsingularity.net> 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: An off-list bug report indicated that watermark boosting was affecting a very small memory system and causing excessive reclaim. Watermark boosting is intended to reduce the mixing of page mobility types within pageblocks for high-order allocations. If the system has so little memory that pages are not even grouped by mobility, then watermark boosting should also be disabled. Signed-off-by: Mel Gorman --- mm/internal.h | 6 +++++- mm/page_alloc.c | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index 3cf20ab3ca01..439561cc90d9 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -534,10 +534,14 @@ unsigned long reclaim_clean_pages_from_list(struct zone *zone, #endif #define ALLOC_KSWAPD 0x200 /* allow waking of kswapd */ +static inline void disable_watermark_boosting(void) +{ + watermark_boost_factor = 0; +} + enum ttu_flags; struct tlbflush_unmap_batch; - /* * only for MM internal work items which do not depend on * any allocations or locks which might depend on allocations diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 3c4eb750a199..c5c05b6dc459 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5810,10 +5810,12 @@ void __ref build_all_zonelists(pg_data_t *pgdat) * made on memory-hotadd so a system can start with mobility * disabled and enable it later */ - if (vm_total_pages < (pageblock_nr_pages * MIGRATE_TYPES)) + if (vm_total_pages < (pageblock_nr_pages * MIGRATE_TYPES)) { page_group_by_mobility_disabled = 1; - else + disable_watermark_boosting(); + } else { page_group_by_mobility_disabled = 0; + } pr_info("Built %u zonelists, mobility grouping %s. Total pages: %ld\n", nr_online_nodes, -- 2.16.4