Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3411929imu; Fri, 18 Jan 2019 09:55:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN4QVyN0EUQx8kHK6fhYdZHVEOMNZDauO9Uxl+5p8hBAAzslKQ6BlBroZzIxNgwky+FjTzaw X-Received: by 2002:a62:8d4f:: with SMTP id z76mr20840994pfd.2.1547834106376; Fri, 18 Jan 2019 09:55:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547834106; cv=none; d=google.com; s=arc-20160816; b=nqjXkzRRR8w/GB4FFRQKL7AekIMYDRv6/Tevn9fqXx5ZNl7wvmcfj2U9wmX+9zr2cN Hsq1OCEKjXbBn/crkdRqg7OTpkQ8zdVzFaaxOm/3twJTtXiDGvdSlXugdonboynly0Lb 6hfoj8mtA+/jaJqnQBIoR0GZE9fdhI1qOhxrZfsWhy84Qg6NL82lOhi7YmF7gUmvjuuu nANHmwdVu9OSlbyukNRSKVQ54KOdLNQCPdNuZzts0Tscq7ZTZKgGwGicpwTAQuXA0T1G mLnhXauaSVH28Z+UUbU7EGqWYMS0XcMMN2YAxeB8jt6571H93R0gyHnRWQZMvMhTfIzA Orew== 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=C0isV1ZJDgqFU3QoOVAtWQlnGfgiq1t7rqJXM+ekiIs=; b=Z+N8JkFJg9iqcU9tArr49JZpRtulz/p0taGyS9Kn1ocv3/96YIaz3QGkCy8OMt2is3 zWGqF2CORnzeKvyQQ/dH1rpxKTmoZjnLGBIpgSiL+V21dOjX0YqHkqrf4FaKxHDmwVEy UhpzEL4ty2aBw2a8YfB1aPkiF4b8qfjBGU40CTBsS/o2nvDTX9bJ0R5HnEDAHq+5i33G UqxMn5tl07QtEwNMeLSFayOy2qaRA7cDKuKjvyY1FortNFhynDHRrfCEx/J6Lp5dcl8l /FNdxrYclZ4YOU2oJPsXHbyEeRXKKSlGtvsvJ5by8fBPAsbI5sGu/kWD6ptRkVq+fK8t XYOA== 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 a2si5580233pfb.166.2019.01.18.09.54.48; Fri, 18 Jan 2019 09:55: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 S1728801AbfARRwu (ORCPT + 99 others); Fri, 18 Jan 2019 12:52:50 -0500 Received: from outbound-smtp16.blacknight.com ([46.22.139.233]:46689 "EHLO outbound-smtp16.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728698AbfARRwu (ORCPT ); Fri, 18 Jan 2019 12:52:50 -0500 Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp16.blacknight.com (Postfix) with ESMTPS id 33BD01C35B2 for ; Fri, 18 Jan 2019 17:52:48 +0000 (GMT) Received: (qmail 750 invoked from network); 18 Jan 2019 17:52:48 -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:48 -0000 From: Mel Gorman To: Andrew Morton Cc: David Rientjes , Andrea Arcangeli , Vlastimil Babka , Linux List Kernel Mailing , Linux-MM , Mel Gorman Subject: [PATCH 06/22] mm, migrate: Immediately fail migration of a page with no migration handler Date: Fri, 18 Jan 2019 17:51:20 +0000 Message-Id: <20190118175136.31341-7-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 Pages with no migration handler use a fallback handler which sometimes works and sometimes persistently retries. A historical example was blockdev pages but there are others such as odd refcounting when page->private is used. These are retried multiple times which is wasteful during compaction so this patch will fail migration faster unless the caller specifies MIGRATE_SYNC. This is not expected to help THP allocation success rates but it did reduce latencies very slightly in some cases. 1-socket thpfioscale 4.20.0 4.20.0 noreserved-v2r15 failfast-v2r15 Amean fault-both-1 0.00 ( 0.00%) 0.00 * 0.00%* Amean fault-both-3 3839.67 ( 0.00%) 3833.72 ( 0.15%) Amean fault-both-5 5177.47 ( 0.00%) 4967.15 ( 4.06%) Amean fault-both-7 7245.03 ( 0.00%) 7139.19 ( 1.46%) Amean fault-both-12 11534.89 ( 0.00%) 11326.30 ( 1.81%) Amean fault-both-18 16241.10 ( 0.00%) 16270.70 ( -0.18%) Amean fault-both-24 19075.91 ( 0.00%) 19839.65 ( -4.00%) Amean fault-both-30 22712.11 ( 0.00%) 21707.05 ( 4.43%) Amean fault-both-32 21692.92 ( 0.00%) 21968.16 ( -1.27%) The 2-socket results are not materially different. Scan rates are similar as expected. Signed-off-by: Mel Gorman Acked-by: Vlastimil Babka --- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c index 52b04c217e30..4512afab46ac 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -916,7 +916,7 @@ static int fallback_migrate_page(struct address_space *mapping, */ if (page_has_private(page) && !try_to_release_page(page, GFP_KERNEL)) - return -EAGAIN; + return mode == MIGRATE_SYNC ? -EAGAIN : -EBUSY; return migrate_page(mapping, newpage, page, mode); } -- 2.16.4