From patchwork Fri Jul 6 08:14:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia He X-Patchwork-Id: 10511003 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4F29D600CA for ; Fri, 6 Jul 2018 08:15:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40B5228161 for ; Fri, 6 Jul 2018 08:15:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 348F5284EE; Fri, 6 Jul 2018 08:15:04 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, 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 EADE028161 for ; Fri, 6 Jul 2018 08:15:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0F4DE6B000A; Fri, 6 Jul 2018 04:15:02 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 07F686B000C; Fri, 6 Jul 2018 04:15:02 -0400 (EDT) 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 DEC556B000D; Fri, 6 Jul 2018 04:15:01 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f200.google.com (mail-pf0-f200.google.com [209.85.192.200]) by kanga.kvack.org (Postfix) with ESMTP id 95F966B000A for ; Fri, 6 Jul 2018 04:15:01 -0400 (EDT) Received: by mail-pf0-f200.google.com with SMTP id n17-v6so6642317pff.10 for ; Fri, 06 Jul 2018 01:15:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=KPtnS3pR0e6k1wruvZ/TmyKB2yqnQlAi9FUL26a/INc=; b=GVyRCqZW2LV1a7YF1Ohq+qMFpm0EY6tajfZTk2ZjJhP3pwo9R0krt0qsm7LXRd3hOR 2PcWuTL4b+zMfCsQis9YiT+gyUC1RjUQ30lWZpQrEslK0J+pI5VnvfeCZODJ/qeE2aAZ VBQzqlifx2iF2mE8YcXneONswGP566aE60aI9zZqO+6vVITQv4145mf1W1s57NnVCxjA OiBmD6Gxf3VWPvBFZk8+bkHxLHI8k8ikSzxa0QPe44J0vGW73tB4rbiUBA1esf3t8Icm A4RB6G2GeUiItVQhaKyapp2tFMLYY0yx0wTNKb05+CZ1R+XrJcxNO3KuBYRqftCKegpZ KSCQ== X-Gm-Message-State: APt69E3K92PNjKslN2JZbnn0eqPzlhXQ9tAb3uMaJOqlkLdeQv/4ege/ /Dpv8MNmhZ1kVrtt5q5Xp9San2h/fjsv9sc0VD/ZBjQN7oJtBvRN0iRgo8176INLWBOCXRRIhW6 KneqLATslaCGVc4CGNTR+Kvf+LGgwNbbEahcKAJu3y+v+8EvOXHIQL9o5JcOq8Lb4l451mAmgwT ekSNTXwWQheyc31GUG6Px0RxcUZPoC7lm3CUc5jIqp8K6oWaNzndseXykXvGNJtsSzRe94z2Lgs nt8MXiYYhYP1Q9N0yUKr/Yb3tp8TRg8Lt+K0MJ/o2uhI/tgAboh4Fj598P6TJlQmztF31bB+Jer p45HagjxUZQdGt+nyK8UJm5tDdg4WUb5inLG9ufMO1mwC8ghUFM8C1KdWKstecIkbh44UvYen8P b X-Received: by 2002:a17:902:7481:: with SMTP id h1-v6mr9585272pll.183.1530864901312; Fri, 06 Jul 2018 01:15:01 -0700 (PDT) X-Received: by 2002:a17:902:7481:: with SMTP id h1-v6mr9585228pll.183.1530864900567; Fri, 06 Jul 2018 01:15:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530864900; cv=none; d=google.com; s=arc-20160816; b=VAb8uVpNCjF1TR0hnv9KPgO0RoF6yFDnqxC6uV2UQxytpkrVUhGZETCckroQVhEfJA uYHR8DwxHaA4gdIr1/dYOapQm+HqW04NjhLcpp5soPJH29mp4gnqgmfE6pI+OUqMEeV7 joqqPmBuhIxnzVR4z4HoCu42crY94uQft2lcNStLWbh7Sw7Lluhy5oQLnLpM0eIZXvX0 qgbLa2o2z+9no5WHiJgHpno9eO/4/+M1ke8n3+CrHB3d/Zz03Bj5gzJdIAe3u8pARqgU dO7P1B5nPW0EnUwXZEgNv1GIXB711EK2StAJ9uQYM6OcgewjonQHbxA1v+20wqaRNt+P crdg== 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 :dkim-signature:arc-authentication-results; bh=KPtnS3pR0e6k1wruvZ/TmyKB2yqnQlAi9FUL26a/INc=; b=gSvZWN/vx1edF5o1t1B64A+BSFO3dspJjorWO5y2avpfH3uD+QAnUPOm5eaggmnj6G gXfXLDE0udkFCnXK3fWKWECTO+Efp+Q/ZG75KY7HYdN4JQc2q10a4hCR1j7VGmmR7p/y OUUNz99Vu7Kl7tRxa7T26gf5MgUKRnSZ5drpGptU3bIK5sCBs+pOU26GHZTOuq6n4p23 fv5ScvhPjf9rWqwfD11gdrBh8O21v5DQ1NKR7dwracWOsy9sAic9tP0STatH+KlPBO2T pz6nc5crvQCwTvdYg8CppX7TiLmYnPOZ+TB7gHTvs27gI18Kb6F1erw00XzAtjoHmTJx dMPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kNFYHImM; spf=pass (google.com: domain of hejianet@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=hejianet@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id x1-v6sor2605779plo.120.2018.07.06.01.15.00 for (Google Transport Security); Fri, 06 Jul 2018 01:15:00 -0700 (PDT) Received-SPF: pass (google.com: domain of hejianet@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kNFYHImM; spf=pass (google.com: domain of hejianet@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=hejianet@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KPtnS3pR0e6k1wruvZ/TmyKB2yqnQlAi9FUL26a/INc=; b=kNFYHImMC/45MdigANa2QLU2iw0muDk6UGej7TqyveuZfNRAXHnQFN2McdRcAPu/oB Z2ySewh42xNfvOo7i1Q5jJwC+WwimW1Ikdot9PFzkpODnynjtVax9K04wiubC/vOi2Cj FRDWw3lpTTR/8i4Jof3PGyebe1EBjjYY7t7I0YZpw+5u9pMAcaMFdLG4fRVLbti/6j+w lMddoaJNGKTyVW79OeMOpj5dq/xJs+AQHV+Ez1RTxHMgpQAG9/fQNPZpxuU9R4k5KqnC 2/tvVwwqzaHYNqWVI0GwgLMkyC9b9AHmP5S5i6BLIA7KoRScLuHC+heeIKqYoZq8p8Au /1Fg== X-Google-Smtp-Source: AAOMgpfhNmsZVN3wrbPmFvFavr4jbMT4C5yNyFZDfpBak9N5yBiuRp14Wf8+5LcPDm2OB/SwdqFN1g== X-Received: by 2002:a17:902:8d96:: with SMTP id v22-v6mr9248199plo.176.1530864900341; Fri, 06 Jul 2018 01:15:00 -0700 (PDT) Received: from ct7host.localdomain ([38.106.11.25]) by smtp.gmail.com with ESMTPSA id c141-v6sm4673049pfc.25.2018.07.06.01.14.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jul 2018 01:14:59 -0700 (PDT) From: Jia He To: Russell King , Andrew Morton , Michal Hocko , Catalin Marinas , Mel Gorman , Will Deacon , Mark Rutland , "H. Peter Anvin" Cc: Pavel Tatashin , Daniel Jordan , AKASHI Takahiro , Gioh Kim , Steven Sistare , Daniel Vacek , Eugeniu Rosca , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-mm@kvack.org, James Morse , Ard Biesheuvel , Steve Capper , Thomas Gleixner , Ingo Molnar , Greg Kroah-Hartman , Kate Stewart , Philippe Ombredanne , Johannes Weiner , Kemi Wang , Petr Tesarik , YASUAKI ISHIMATSU , Andrey Ryabinin , Nikolay Borisov , richard.weiyang@gmail.com, Jia He , Jia He Subject: [PATCH v10 1/6] arm: arm64: introduce CONFIG_HAVE_MEMBLOCK_PFN_VALID Date: Fri, 6 Jul 2018 16:14:15 +0800 Message-Id: <1530864860-7671-2-git-send-email-hejianet@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1530864860-7671-1-git-send-email-hejianet@gmail.com> References: <1530864860-7671-1-git-send-email-hejianet@gmail.com> 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 Make CONFIG_HAVE_MEMBLOCK_PFN_VALID a new config option so it can move memblock_next_valid_pfn to generic code file. All the latter optimizations are based on this config. The memblock initialization time on arm/arm64 can benefit from this. Signed-off-by: Jia He Reviewed-by: Pavel Tatashin --- arch/arm/Kconfig | 4 ++++ arch/arm64/Kconfig | 4 ++++ mm/Kconfig | 3 +++ 3 files changed, 11 insertions(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 843edfd..7ea2636 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1642,6 +1642,10 @@ config ARCH_SELECT_MEMORY_MODEL config HAVE_ARCH_PFN_VALID def_bool ARCH_HAS_HOLES_MEMORYMODEL || !SPARSEMEM +config HAVE_MEMBLOCK_PFN_VALID + def_bool y + depends on HAVE_ARCH_PFN_VALID + config HAVE_GENERIC_GUP def_bool y depends on ARM_LPAE diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 42c090c..26d75f4 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -778,6 +778,10 @@ config ARCH_SELECT_MEMORY_MODEL config HAVE_ARCH_PFN_VALID def_bool ARCH_HAS_HOLES_MEMORYMODEL || !SPARSEMEM +config HAVE_MEMBLOCK_PFN_VALID + def_bool y + depends on HAVE_ARCH_PFN_VALID + config HW_PERF_EVENTS def_bool y depends on ARM_PMU diff --git a/mm/Kconfig b/mm/Kconfig index 94af022..28fcf54 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -137,6 +137,9 @@ config HAVE_MEMBLOCK_NODE_MAP config HAVE_MEMBLOCK_PHYS_MAP bool +config HAVE_MEMBLOCK_PFN_VALID + bool + config HAVE_GENERIC_GUP bool