From patchwork Fri Jul 6 09:01:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia He X-Patchwork-Id: 10511181 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 0229160325 for ; Fri, 6 Jul 2018 09:09:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5B7F284ED for ; Fri, 6 Jul 2018 09:09:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8F3428501; Fri, 6 Jul 2018 09:09:31 +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=-2.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7767B28478 for ; Fri, 6 Jul 2018 09:09:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=pkQ4iUahSWgc5JaosrhQRBvPkxV2RBVVnw91FGwDa3U=; b=G2QL5SPmfDXFQWrvi1ZtA4zSn/ 8bQWq53eUnK8oiYrL56OOn1Sy8HTIMEoj5xf8AeHIFjpccfixO67mjSl8Z9tBA5RUHTrjenDU26+C g9MeVhAGTMVW7AvfsoxNLKHtIiAhtbmdXLQtRdLI7ZN3Bs6Gw9NPiuXB/D+PDQdKdcRCJW/Pv9VAp 8bbhasFuGgxyEcoHrjzX5eKLD2QbT0YFYCKfc80wPdo4O+M4Gqmv4ZaAZKSTznpTSkXEA2IJWcx/3 ToWDDrz+YDMK653RZRn1+9c0EkLKIZEG7LuEK5HIBXXyXEqQWhSFh5wMKGD167aW5vx9dZoezzari yaK/E/aA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fbMk1-0006ro-5l; Fri, 06 Jul 2018 09:09:25 +0000 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fbMcr-0001IP-5P for linux-arm-kernel@lists.infradead.org; Fri, 06 Jul 2018 09:02:05 +0000 Received: by mail-pf0-x241.google.com with SMTP id j3-v6so7884078pfh.11 for ; Fri, 06 Jul 2018 02:01:51 -0700 (PDT) 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=LuRqVoZPEbRWIfqYU1MU6QCSF8B6Zg5N9a3RwlgIKRCOR+KVsOSSj3viQldv3hmGMf GMSkCkr+MrV5JCQcfIvsgI4DDC9ML5GkQb19ltWaOTB4AzfmKCzgjKRkNygsZH9jSriT liB+Wn1NRDc8xIbC14v03tg9J5Wgg0toGMNXaAl6UhXKNfgVETWdYs5mehhfD1NBgb/C ep2YF3ukJWurieDqljq39BX87TJXZYD9L7euZ87hiDciWQxJLS/+gLNXtGKoerax6Hdj KNsPLQo9vY1gxp+7TAKiN2aC57Tw3gHCMDp/pxVyDJLrfdn1MeIRlzTFToh5C0NGJGZm YbmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KPtnS3pR0e6k1wruvZ/TmyKB2yqnQlAi9FUL26a/INc=; b=YffDOrXlfVwEvOKPRI9f7gnkh9pmG1Wpbybg7FDg5u0bgrBZ06Qw847VWEFbqYD1NJ gW1Kg4UMkIbi2LaHxp4gXye+P0KJjSWwuEAj8/GEfmfbJ6Vf9eMoebNvJfmpHMrghgZm Gv1oX8468mhi9QFqSfAh+uIF6gosCvQCX10AD2XFkohhpwHlpbVbTTQw1f+IUEQsKFAd 2+X4p81kulA2BmTHSYLstM9BgElJTcceKn1gsN/Vi9zpNE/JNcifwptbXIEVo43XAT0O G4h6M3a2qae38Z+o33Dkb9zYz8AFpGboxwgyRVrpy7qelSdcBmVNarcZiK1tJ9i0MHUJ GKoQ== X-Gm-Message-State: APt69E12meHsJC7W2LFL8wQbkBOxwwxHv79k5xZY9skSPFIaWBQ6Onx9 qGUe2DTkMUwh2FSpOK1GUAQ= X-Google-Smtp-Source: AAOMgpehkcfeqbchcOBmDvMMovxPJ2BktsOoy3RbIzObSZLAU+KvZD+8RQxXtQQp7oWfHac06YzHZw== X-Received: by 2002:a62:748:: with SMTP id b69-v6mr9805036pfd.177.1530867710772; Fri, 06 Jul 2018 02:01:50 -0700 (PDT) Received: from ct7host.localdomain ([38.106.11.25]) by smtp.gmail.com with ESMTPSA id e5-v6sm10837092pgs.59.2018.07.06.02.01.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jul 2018 02:01:50 -0700 (PDT) From: Jia He To: Russell King , Catalin Marinas , Will Deacon , Mark Rutland , Ard Biesheuvel , Andrew Morton , Michal Hocko Subject: [RESEND PATCH v10 1/6] arm: arm64: introduce CONFIG_HAVE_MEMBLOCK_PFN_VALID Date: Fri, 6 Jul 2018 17:01:10 +0800 Message-Id: <1530867675-9018-2-git-send-email-hejianet@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1530867675-9018-1-git-send-email-hejianet@gmail.com> References: <1530867675-9018-1-git-send-email-hejianet@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180706_020201_479945_FAB4737D X-CRM114-Status: GOOD ( 12.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gioh Kim , Wei Yang , linux-mm@kvack.org, Eugeniu Rosca , Petr Tesarik , Nikolay Borisov , Jia He , Pavel Tatashin , Daniel Jordan , AKASHI Takahiro , Vlastimil Babka , Andrey Ryabinin , Laura Abbott , Daniel Vacek , Mel Gorman , Vladimir Murzin , Kees Cook , Philip Derrin , YASUAKI ISHIMATSU , Jia He , Kemi Wang , linux-arm-kernel@lists.infradead.org, Steve Capper , linux-kernel@vger.kernel.org, James Morse , Johannes Weiner MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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