Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3410956imu; Fri, 18 Jan 2019 09:54:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN5+ACUuImdThC0oNwf43qANJMd9oc/B9/oLwLQ+bmOQjUTc27xxDKjsy9BNtY12P2YNRko4 X-Received: by 2002:a63:955a:: with SMTP id t26mr18878530pgn.449.1547834046130; Fri, 18 Jan 2019 09:54:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547834046; cv=none; d=google.com; s=arc-20160816; b=B7ACmpzqpLioz+g3lwWDC2sOus19sVFDO7oCrDlK3bYAaR2OE0l8OvRwG4ASAq/d+u W24EBxyrZG9RrHNtXXSOtxvU4KHQxrzW+Mmb4zyIMj6C3hmarMy/c5732cO8Ksm9gIDt ob1zKZEdH8XOefsiHc3zls76Uyo3QFvdK8mmhMmvEbXIRTRtfIv8J3GeSZMAPgfO59ah yoXIw4RXAQytTkFaE8M5/PKRRx6avDHI1bA8KBPJnXnbXM1TRo28Pj54yk0z9dVs9JTy ORvN6CBUrEHoWMutkukKVqMah/bpW4EbXHyz9cIKxLJJgWLAuChy//ikho1KwBpWEQ+Q YkWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=KxB+olxFRz15ByQGQdOPEkv73792TGdbwQgnAht0mak=; b=kxAnQSo7LFakp5t29oT+VPA2tbZ2tg3AqklkMf+Ir1ilrGsc8CRNp9xqL5qQYyowXq CUFt45o9ANSNkDRdaBM8eiQnb6FlQbu7xS3/zZNEpx9CLWGaA2uPUM26L62bv4k/ECBy XMJv1aRloEMg+TYTfu7SbdnXhF8pHFi71c4T2AxEwxFKLPxlBlW1Gk/dnjEbyDs0FL8K 7f1iHVwDNSczn6FdH299PHXNjCQgO6BQHlHenFNkjN+uYbKDUn0LeVGfDgQS2umS1GgS Hz2aolhrSCoTclzerT76/H7Zn0qQvNuW0oXvoxP4fUckQps6cz+epVG/qIJN5ttvQp4X W5jg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 193si254940pgc.220.2019.01.18.09.53.50; Fri, 18 Jan 2019 09:54:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728691AbfARRwU (ORCPT + 99 others); Fri, 18 Jan 2019 12:52:20 -0500 Received: from outbound-smtp12.blacknight.com ([46.22.139.17]:39375 "EHLO outbound-smtp12.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727323AbfARRwU (ORCPT ); Fri, 18 Jan 2019 12:52:20 -0500 Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp12.blacknight.com (Postfix) with ESMTPS id A85931C3584 for ; Fri, 18 Jan 2019 17:52:17 +0000 (GMT) Received: (qmail 31737 invoked from network); 18 Jan 2019 17:52:17 -0000 Received: from unknown (HELO stampy.163woodhaven.lan) (mgorman@techsingularity.net@[37.228.229.96]) by 81.17.254.9 with ESMTPA; 18 Jan 2019 17:52:17 -0000 From: Mel Gorman To: Andrew Morton Cc: David Rientjes , Andrea Arcangeli , Vlastimil Babka , Linux List Kernel Mailing , Linux-MM , Mel Gorman Subject: [PATCH 03/22] mm, compaction: Remove last_migrated_pfn from compact_control Date: Fri, 18 Jan 2019 17:51:17 +0000 Message-Id: <20190118175136.31341-4-mgorman@techsingularity.net> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190118175136.31341-1-mgorman@techsingularity.net> References: <20190118175136.31341-1-mgorman@techsingularity.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 c15b4bbc9e9e..e59dd7a7564c 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 867af5425432..f40d06d70683 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -188,7 +188,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; -- 2.16.4