Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp91558imu; Fri, 14 Dec 2018 15:06:49 -0800 (PST) X-Google-Smtp-Source: AFSGD/UZAtbjsAFCfzOz0QfObcQZX58FvnrLQ/83O5/qycReC8EYCw4EsOnLQ9/6uZ/2cEazBmoI X-Received: by 2002:a62:f247:: with SMTP id y7mr4579973pfl.25.1544828808957; Fri, 14 Dec 2018 15:06:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544828808; cv=none; d=google.com; s=arc-20160816; b=hVxoM6F94pFSbCLoXBpbrmvP2tsrcxUUGNODjjMmiCo5kh/sb5IUQJcS0Xd67x0etC gT2KzW18TObzIOZgxIbzZdHmdL8w2w/Y0b1eY/2YECPp3mKGal8YjvqOjcsPGg3E2pso PSrtgdMJJ7l/VxFjE+ORwL16EIxDWwyJR/K2AlHz6SvZ+snge50tl/9vTVqiomvFFWc4 qaydyr1/ceeD4GrJEK2HbqntJAMmpEHVITaBmBkX4SsfypUXV5lhkv7RIF9Xy74DC0LL jXgkVRV0W76f/OjYl3ffjapdSQBm/WuoFXL+4ChMj4BIfhgFcnXu0i6WExpvajnRN0cq qeIw== 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=Dw0UV1TCQFA4d8gJKrA3/p7ohO2soOuPiIEMi/M3pF4=; b=RgeCanWEC7COSU6T3Ta+FtjkhKfVrpViFAsroHcdNDBWOxGUemoW/pscKF0nvITQXb usRBjFq+iyc6GrkesTtkfdMxhOWbOl2jS73fu/YJxUBG++f2YCtNDvtrOrIX39pV3Zkg jb/iDQJes9eQK45F1+k89eq+tIiyDlQALTjZEEhRWDKj4sOGYz1kwvVjjE3KgEO6qg+N L+GYMZ051E+9WBn7uUaOQMTxyekRWqvMQ0n8xdQnj+1wn7nhvR9toH3ceimx6lvWZSUI OwjLaUV1gGAPJsWitF/gEh0ycE/U72RHzd7x+1PAkoiNHNEGy24L8twrU+jYR2S16Huq ximw== 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 y6si5117510pfi.228.2018.12.14.15.06.33; Fri, 14 Dec 2018 15:06:48 -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 S1730924AbeLNXDw (ORCPT + 99 others); Fri, 14 Dec 2018 18:03:52 -0500 Received: from outbound-smtp13.blacknight.com ([46.22.139.230]:47987 "EHLO outbound-smtp13.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726389AbeLNXDN (ORCPT ); Fri, 14 Dec 2018 18:03:13 -0500 Received: from mail.blacknight.com (unknown [81.17.254.10]) by outbound-smtp13.blacknight.com (Postfix) with ESMTPS id 1A3701C20AD for ; Fri, 14 Dec 2018 23:03:12 +0000 (GMT) Received: (qmail 31244 invoked from network); 14 Dec 2018 23:03:11 -0000 Received: from unknown (HELO stampy.163woodhaven.lan) (mgorman@techsingularity.net@[37.228.245.71]) by 81.17.254.9 with ESMTPA; 14 Dec 2018 23:03:11 -0000 From: Mel Gorman To: Linux-MM Cc: David Rientjes , Andrea Arcangeli , Linus Torvalds , Michal Hocko , ying.huang@intel.com, kirill@shutemov.name, Andrew Morton , Linux List Kernel Mailing , Mel Gorman Subject: [PATCH 05/14] mm, compaction: Skip pageblocks with reserved pages Date: Fri, 14 Dec 2018 23:03:01 +0000 Message-Id: <20181214230310.572-6-mgorman@techsingularity.net> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20181214230310.572-1-mgorman@techsingularity.net> References: <20181214230310.572-1-mgorman@techsingularity.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reserved pages are set at boot time, tend to be clustered and almost never become unreserved. When isolating pages for migrating, skip the entire pageblock is one PageReserved page is encountered on the grounds that it is highly probable the entire pageblock is reserved. The impact depends on the machine and timing but both thpscale and thpfioscale when using MADV_HUGEPAGE show a reduction of scanning and fault latency on a 1-socket machine. The 2-socket results were too noisy to draw any meaningful conclusion but it's safe to assume less scanning is useful. 1-socket thpfioscale 4.20.0-rc6 4.20.0-rc6 mmotm-20181210 noreserved-v1r4 Amean fault-base-1 1481.32 ( 0.00%) 1443.63 ( 2.54%) Amean fault-huge-1 1118.17 ( 0.00%) 981.30 * 12.24%* Amean fault-both-1 1176.43 ( 0.00%) 1052.64 * 10.52%* Compaction migrate scanned 3860713 3294284 Compaction free scanned 613786341 433423502 Kcompactd migrate scanned 408711 291915 Kcompactd free scanned 242509759 217164988 Signed-off-by: Mel Gorman --- mm/compaction.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mm/compaction.c b/mm/compaction.c index 3afa4e9188b6..8134dba47584 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -827,6 +827,13 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, goto isolate_success; } + /* + * A reserved page is never freed and tend to be + * clustered in the same pageblocks. Skip the block. + */ + if (PageReserved(page)) + low_pfn = end_pfn; + goto isolate_fail; } -- 2.16.4