Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp3551870ima; Mon, 4 Feb 2019 00:56:36 -0800 (PST) X-Google-Smtp-Source: ALg8bN42xyKVeh0Lgf4Q7w3etdeolz1ZzUIkt7MXsKwU/s7N/36oDTNALOyBKWX3IYo4kVN+6tcr X-Received: by 2002:a17:902:112c:: with SMTP id d41mr48964914pla.144.1549270596363; Mon, 04 Feb 2019 00:56:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549270596; cv=none; d=google.com; s=arc-20160816; b=lrhjzbGwCdQaUe4IDU5j597lb1NzmCop3CKoxNW+qnL/pmYgRkxC8dE9QMMWK1HCsk k0YEOw1uI8Llg8pgzcgK73j9cuphCkh3sPx0p+NX0/bcvA3csnlKj1NVxv69FES8tvtW m3d1LIfhQNyspXsvMjZcDArytU/BUKDxmiRTswywwr0GHCGTpdAHVJyTUHTl4AYSX03d vXIZrr0kOfLOMCpRmDxwW1HyztV54U2gZuAqd8o2Vc7fqXhZBlLkaYuRvr52nuCbz0Dt udq/X/R7Ak0pLHwqd6k+ZtdY5ErxVxkckBn0byEBP3YZszsd5Hhb3tXi6y8xTKoSL+n8 M+Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=LZuVEIh5iPG9fPzOuRrWUdtrl0NnUvQQYHBYDYgN95M=; b=Y8geLkH6NotPN7E7VYEEFKCICgLIN1i7K3sogTAOdRk1RUVf9yZyX60cWfsTHPmz84 aBlEG11Tq/gL7h1uhqBNFTzKxMoOvCnHL/ZgOTswBp5Mie/PvlyM44EHz1VfBJbPYEnW E27cDHr5qMkvUkAfYy/7q8HCOizdvNV9xfWSaMsrBv+As65vUtObvbR2CCx4Fm1NaQDC CDdiFwPfpN9X3nHPwROxzIzI2nBDYBkaWGhyiBkSjUi0F8BsofOece2KTp+5gyyNijsZ m05Rhqb3C3c64oniExBXGFBzYhxbtvzBTFZim9/aHxMxwbHqkCrzjg5tIo0ff8aABe6x V82w== 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 g128si6625896pgc.352.2019.02.04.00.56.20; Mon, 04 Feb 2019 00:56:36 -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 S1728578AbfBDIzR (ORCPT + 99 others); Mon, 4 Feb 2019 03:55:17 -0500 Received: from outbound-smtp02.blacknight.com ([81.17.249.8]:60718 "EHLO outbound-smtp02.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728016AbfBDIzQ (ORCPT ); Mon, 4 Feb 2019 03:55:16 -0500 Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp02.blacknight.com (Postfix) with ESMTPS id 1549898686 for ; Mon, 4 Feb 2019 08:55:15 +0000 (UTC) Received: (qmail 18787 invoked from network); 4 Feb 2019 08:55:15 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[37.228.225.79]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 4 Feb 2019 08:55:14 -0000 Date: Mon, 4 Feb 2019 08:55:13 +0000 From: Mel Gorman To: Andrew Morton Cc: Vlastimil Babka , David Rientjes , Andrea Arcangeli , Linux List Kernel Mailing , Linux-MM Subject: [PATCH] mm, compaction: Use free lists to quickly locate a migration source -fix Message-ID: <20190204085513.GK9565@techsingularity.net> References: <20190118175136.31341-1-mgorman@techsingularity.net> <20190118175136.31341-10-mgorman@techsingularity.net> <4a6ae9fc-a52b-4300-0edb-a0f4169c314a@suse.cz> <20190201150614.GJ9565@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20190201150614.GJ9565@techsingularity.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Vlastimil correctly pointed out that when a fast search fails and cc->migrate_pfn is reinitialised to the lowest PFN found that the caller does not use the updated PFN. This is a fix for the mmotm patch mm-compaction-use-free-lists-to-quickly-locate-a-migration-source.patch Signed-off-by: Mel Gorman diff --git a/mm/compaction.c b/mm/compaction.c index 92d10eb3d1c7..d249f257da7e 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1238,14 +1238,16 @@ update_fast_start_pfn(struct compact_control *cc, unsigned long pfn) cc->fast_start_pfn = min(cc->fast_start_pfn, pfn); } -static inline void +static inline unsigned long reinit_migrate_pfn(struct compact_control *cc) { if (!cc->fast_start_pfn || cc->fast_start_pfn == ULONG_MAX) - return; + return cc->migrate_pfn; cc->migrate_pfn = cc->fast_start_pfn; cc->fast_start_pfn = ULONG_MAX; + + return cc->migrate_pfn; } /* @@ -1361,7 +1363,7 @@ static unsigned long fast_find_migrateblock(struct compact_control *cc) * that had free pages as the basis for starting a linear scan. */ if (pfn == cc->migrate_pfn) - reinit_migrate_pfn(cc); + pfn = reinit_migrate_pfn(cc); return pfn; }