From patchwork Fri Jan 4 12:49:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mel Gorman X-Patchwork-Id: 10748301 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 CC14A14E5 for ; Fri, 4 Jan 2019 12:50:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC3F7283C9 for ; Fri, 4 Jan 2019 12:50:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B078E28434; Fri, 4 Jan 2019 12:50:56 +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 38490283C9 for ; Fri, 4 Jan 2019 12:50:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 311CE8E00D6; Fri, 4 Jan 2019 07:50:55 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2E71A8E00AE; Fri, 4 Jan 2019 07:50:55 -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 1B03F8E00D6; Fri, 4 Jan 2019 07:50:55 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by kanga.kvack.org (Postfix) with ESMTP id B7DC28E00AE for ; Fri, 4 Jan 2019 07:50:54 -0500 (EST) Received: by mail-ed1-f72.google.com with SMTP id m19so35039164edc.6 for ; Fri, 04 Jan 2019 04:50:54 -0800 (PST) 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=VYm1JewsY9/4gPesnVldquFFzwNaTy3YVh6A0ce8hdY=; b=eT3GJpuDnBMAajk3zlNQ4iEEWtWFoI9E+o5DU5sL4qw1gMOJZH+fSia+hLlhw/JnI/ yAppcu22qP0onSHUhegChzNXxwXUq9bfM7zXbS0uwMgh//J9u/k0HTVTdmD/PiALDj0W 4mAgMv0rymRzKDpZ5HXYytTAfpOJ4iASgzCDuQGQVPp7ZPq+vpzBYMDfo8vutdyim9G8 GkK57Xp7e3DpFjbwTfgZNBB8vSXZ1huVChFhNQp1ufPWYBKkT1WpbRdbF1kKvBnGckPu JDb/pzEsguBz9kq2WtX2Yu61w1wnJ4/ac3IJkbUjRbKXSnyKtlRJZ909rzvP5lrY0TG8 8Qnw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of mgorman@techsingularity.net designates 46.22.139.17 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net X-Gm-Message-State: AA+aEWZXFdIyHLVuBsXa2aGwTq2TuZS4Qp+cQP4u5K1Lx9izcBlwS5fJ ncISMKKA13yklwyl1XVYsssiRg9vs38NHKpnf/j+PuNxigb9OGfajg+5IBg6BexyUeNAlR0YOVz v/8c4hgw10Uk1gP+Y1ouDegn3/jygkkdvRiU8oN9AA5aEF9Ihv/JY3HNiMa5/nulfIg== X-Received: by 2002:a17:906:3b4b:: with SMTP id h11-v6mr38709235ejf.183.1546606254222; Fri, 04 Jan 2019 04:50:54 -0800 (PST) X-Google-Smtp-Source: AFSGD/XMREJYWiusC70j7KDx7ceSqIHkbU4yluj9xtAbO3Q94eA278hLDv/mdCLK7f/j6W4yPsh1 X-Received: by 2002:a17:906:3b4b:: with SMTP id h11-v6mr38709190ejf.183.1546606253172; Fri, 04 Jan 2019 04:50:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546606253; cv=none; d=google.com; s=arc-20160816; b=bL2PXb5UgcbwCJ0i1pahSbLAgm/KXb9HQ+xyLsaMyIdDbVIak/sYJQUh3jLfS3eqqA u9Wg8dnTkIWPXNtFC0EI+JnArI/5jS4edsRGdRmvkN3oFOB7/yGt5R7RagSKWPiXYuHI fBPldZT7gIUzxIevO5jVEg46L34JXMvfwCBhGjcx4ABMEnkS3r05jBtblFlwJqfjo3Ca XPRnR03DLnQ3bBZKK15Gtkqg+x0YN7Yqs8aPoTDA1hENCX5c/l3SBq7NGau8P83tVmpN MGsHIyU/I3kABIjmQ4f/D0880hSm27UomGttqGReTk+vUpzNg/RgJPwaOHGnewQtcpEn JI8A== 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; bh=VYm1JewsY9/4gPesnVldquFFzwNaTy3YVh6A0ce8hdY=; b=eb+Dd2UjD/oMhxBaISQHdr0ZzW1+GiChdMYm1Lzq+5MZac5KamATkushgW4e4dJ/6Q YKEmBRXnhwAEYCcueUi77d5rHdk6jTQN9ZBBYIKm9BrhNYE71GJo0kd7fhTKksV3sNHE wu5IUSyGWzTLDYO4MQ9kzcnqK+f6vQb/arOq5sB8/jbLuvUFO4f1RxHeAkLZtf/JhBm0 H59lE3F9jObn2Ho2rnE2mSKn18tcQTTtIalO7TF1eBGs1w9Qic5LCKe/sWw7e2AwusY+ xIJXwhPyaZk5ZXNnqnt/DcfCA7wDOkLmoU/VvADCDEGcTE8f4AM9zg5wx4qTUuaOP9fA YUsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of mgorman@techsingularity.net designates 46.22.139.17 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net Received: from outbound-smtp12.blacknight.com (outbound-smtp12.blacknight.com. [46.22.139.17]) by mx.google.com with ESMTPS id s34si4249719edb.417.2019.01.04.04.50.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 04:50:53 -0800 (PST) Received-SPF: pass (google.com: domain of mgorman@techsingularity.net designates 46.22.139.17 as permitted sender) client-ip=46.22.139.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of mgorman@techsingularity.net designates 46.22.139.17 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp12.blacknight.com (Postfix) with ESMTPS id CD9D81C1D6B for ; Fri, 4 Jan 2019 12:50:52 +0000 (GMT) Received: (qmail 30568 invoked from network); 4 Jan 2019 12:50:52 -0000 Received: from unknown (HELO stampy.163woodhaven.lan) (mgorman@techsingularity.net@[37.228.229.96]) by 81.17.254.9 with ESMTPA; 4 Jan 2019 12:50:52 -0000 From: Mel Gorman To: Linux-MM Cc: David Rientjes , Andrea Arcangeli , Vlastimil Babka , ying.huang@intel.com, kirill@shutemov.name, Andrew Morton , Linux List Kernel Mailing , Mel Gorman Subject: [PATCH 03/25] mm, compaction: Remove last_migrated_pfn from compact_control Date: Fri, 4 Jan 2019 12:49:49 +0000 Message-Id: <20190104125011.16071-4-mgorman@techsingularity.net> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190104125011.16071-1-mgorman@techsingularity.net> References: <20190104125011.16071-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: X-Virus-Scanned: ClamAV using ClamSMTP The last_migrated_pfn field is a bit dubious as to whether it really helps but either way, the information from it can be inferred without increasing the size of compact_control so remove the field. Signed-off-by: Mel Gorman Acked-by: Vlastimil Babka --- mm/compaction.c | 25 +++++++++---------------- mm/internal.h | 1 - 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index ef29490b0f46..fb4d9f52ed56 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -886,15 +886,6 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, cc->nr_migratepages++; nr_isolated++; - /* - * Record where we could have freed pages by migration and not - * yet flushed them to buddy allocator. - * - this is the lowest page that was isolated and likely be - * then freed by migration. - */ - if (!cc->last_migrated_pfn) - cc->last_migrated_pfn = low_pfn; - /* Avoid isolating too much */ if (cc->nr_migratepages == COMPACT_CLUSTER_MAX) { ++low_pfn; @@ -918,7 +909,6 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, } putback_movable_pages(&cc->migratepages); cc->nr_migratepages = 0; - cc->last_migrated_pfn = 0; nr_isolated = 0; } @@ -1539,6 +1529,7 @@ static enum compact_result compact_zone(struct zone *zone, struct compact_contro enum compact_result ret; unsigned long start_pfn = zone->zone_start_pfn; unsigned long end_pfn = zone_end_pfn(zone); + unsigned long last_migrated_pfn; const bool sync = cc->mode != MIGRATE_ASYNC; cc->migratetype = gfpflags_to_migratetype(cc->gfp_mask); @@ -1584,7 +1575,7 @@ static enum compact_result compact_zone(struct zone *zone, struct compact_contro cc->whole_zone = true; } - cc->last_migrated_pfn = 0; + last_migrated_pfn = 0; trace_mm_compaction_begin(start_pfn, cc->migrate_pfn, cc->free_pfn, end_pfn, sync); @@ -1593,12 +1584,14 @@ static enum compact_result compact_zone(struct zone *zone, struct compact_contro while ((ret = compact_finished(zone, cc)) == COMPACT_CONTINUE) { int err; + unsigned long start_pfn = cc->migrate_pfn; switch (isolate_migratepages(zone, cc)) { case ISOLATE_ABORT: ret = COMPACT_CONTENDED; putback_movable_pages(&cc->migratepages); cc->nr_migratepages = 0; + last_migrated_pfn = 0; goto out; case ISOLATE_NONE: /* @@ -1608,6 +1601,7 @@ static enum compact_result compact_zone(struct zone *zone, struct compact_contro */ goto check_drain; case ISOLATE_SUCCESS: + last_migrated_pfn = start_pfn; ; } @@ -1639,8 +1633,7 @@ static enum compact_result compact_zone(struct zone *zone, struct compact_contro cc->migrate_pfn = block_end_pfn( cc->migrate_pfn - 1, cc->order); /* Draining pcplists is useless in this case */ - cc->last_migrated_pfn = 0; - + last_migrated_pfn = 0; } } @@ -1652,18 +1645,18 @@ static enum compact_result compact_zone(struct zone *zone, struct compact_contro * compact_finished() can detect immediately if allocation * would succeed. */ - if (cc->order > 0 && cc->last_migrated_pfn) { + if (cc->order > 0 && last_migrated_pfn) { int cpu; unsigned long current_block_start = block_start_pfn(cc->migrate_pfn, cc->order); - if (cc->last_migrated_pfn < current_block_start) { + if (last_migrated_pfn < current_block_start) { cpu = get_cpu(); lru_add_drain_cpu(cpu); drain_local_pages(zone); put_cpu(); /* No more flushing until we migrate again */ - cc->last_migrated_pfn = 0; + last_migrated_pfn = 0; } } diff --git a/mm/internal.h b/mm/internal.h index 9437ba5791db..c6f794ad21a9 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -187,7 +187,6 @@ struct compact_control { unsigned int nr_migratepages; /* Number of pages to migrate */ unsigned long free_pfn; /* isolate_freepages search base */ unsigned long migrate_pfn; /* isolate_migratepages search base */ - unsigned long last_migrated_pfn;/* Not yet flushed page being freed */ struct zone *zone; unsigned long total_migrate_scanned; unsigned long total_free_scanned;