Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp427202imm; Thu, 28 Jun 2018 23:42:16 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIZRwQGPpl/Jb8XPqWHQnEjgw5jBPmVxjXdnChfcx94p0nAXhThQI97h2Qf9AOej0rQC+3t X-Received: by 2002:a65:6645:: with SMTP id z5-v6mr11394613pgv.71.1530254536460; Thu, 28 Jun 2018 23:42:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530254536; cv=none; d=google.com; s=arc-20160816; b=hjDLirGwgbTk5IeP/O6+GzdJep454rYqZj3M9N0yoOP+GSBaR+R4VaIzg+2aJoYVVu qzGj6kW2bALr4Py3PKpM/g2cD6tb+Tc4l1QGgpQmgDFHaJ+l1o1kW3pXcby7LI7fmI7J r8pNaMY3iHn1wu07FZ5mD1ohXZ9NYHpXHd02qcrCrwwMIWvwakbB5fkgjENNdiSDAOJN B3bkhElFM7jXEPj8bpNhX8qRcktlgGEjo/60P8m8ZbwRjmSAI9yZk7VH8QS728HLTzOV bxivPhFtJg45Vp7/6DfLWeqWjTZfd1QId+ujY2P6vcvWDTsbwHqTNMp20R+pli3MDb/6 sRIA== 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:dkim-signature:arc-authentication-results; bh=Lj3wRwFhiqvhjk9/PgujvZmJv6KMETqTDZpMlyrN0qo=; b=Nxcv0LNqpz3e1ENLZz3rkZXXhG1BHVxDhja96rfOcbqjOYaWYuQsWr7v8qOSLyRnSe 7/kgVdU4xPtGGvb7hVBBAYSk39AjX0yVW35BVFs2hpDEDHg1ZISk+BWOPNL+XzuqGvA3 a73p+D3BzVp9jUX/fsvbEWMBtcsOBaioiN2Ke3mMxo5US8LHZcQ526FZ6U04wN2fPq2t xAaXoLKB5gkiEaX+Y3YG0kbVdIsH80I+hiPQICpu9eKS8qXhLfW/HM5nw+1TlKwszcvb rAMZYOgZWZML3IPG6XWl049WyqCwKmU0nSSAngYDP/b/0Fy87R2JYNbSZKCpHTkzV1gG UnyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FUwYH8qv; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3-v6si8427000pfi.230.2018.06.28.23.42.02; Thu, 28 Jun 2018 23:42:16 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FUwYH8qv; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936513AbeF2CaU (ORCPT + 99 others); Thu, 28 Jun 2018 22:30:20 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:37784 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934863AbeF2CaR (ORCPT ); Thu, 28 Jun 2018 22:30:17 -0400 Received: by mail-qt0-f196.google.com with SMTP id a18-v6so6642623qtj.4 for ; Thu, 28 Jun 2018 19:30:16 -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=Lj3wRwFhiqvhjk9/PgujvZmJv6KMETqTDZpMlyrN0qo=; b=FUwYH8qvWlWiDTh3HYwdv6ocoY5tW7AjZEkl8G/MK3GhowSOE1z2Vgonn28QwioLXi h4UmTJ19o6m92F3QkZ5E6fX94lhaSPN/c7cT7HNZ5KzXvA2bIkbgtOxJ2/h2dKf3Rk5l M3fY2i5jo/gJEPt6X2oBY4TxmZ3g899AE04I+Tkw6NkTCfgNhjg2cpOvI6c2YQowqhtS iaSL5bqsnUmVSKkTSTD3A8O4b6RO6CSWrdJvKgL2LiZOav5VLTz1rtVv8sG4I6uY1F8V pz3oHw3jpOLTHK0oiPWa3DjYIFthkVn1QQs9RHzEogIzTiU2oSk7UqZXRwQphvLRgi63 ZHxw== 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=Lj3wRwFhiqvhjk9/PgujvZmJv6KMETqTDZpMlyrN0qo=; b=lbI9pdEMHvRkVEuBIbam+af1WrAi+LOPXE/PQMUOcuWt9WpEtlyzeytdpssrodSGVo RE+A6/vS2p5PJZ7I+qt3pZ52pgNaYC8Icw8pWWC+sSvQlqm3F5nSekgU0QrmhxMBdepX yHaa1ssWteCH/BL5PJmI+mKxxMs4JLkTXQBE9EyAeo6Br+it+dqoXJvVgO4q2ltQePsn fzOEleUkujIFXGw6lQ76I5Q13lHP+iQapoaLrONZYOkoeZzwlO8she3yLY1ceXjVV1/G 749VoIbz9HIG+1xAW9YYwbaA47NBmh8tws4Zb5Yc3QNJUvnPM1+PCNFziKowQ0dCshRI wdSA== X-Gm-Message-State: APt69E1euVxBdHGLO6vATOv+LQRCkDDvXC/sTlwHg3E6KyFTmcnR/vRW //Fp9H1reEkP0cQjLGGRI2g= X-Received: by 2002:a0c:b20e:: with SMTP id x14-v6mr11561299qvd.46.1530239416593; Thu, 28 Jun 2018 19:30:16 -0700 (PDT) Received: from ct7host.localdomain ([38.106.11.25]) by smtp.gmail.com with ESMTPSA id y25-v6sm6390186qtc.48.2018.06.28.19.30.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 19:30:15 -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 v9 1/6] arm: arm64: introduce CONFIG_HAVE_MEMBLOCK_PFN_VALID Date: Fri, 29 Jun 2018 10:29:18 +0800 Message-Id: <1530239363-2356-2-git-send-email-hejianet@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1530239363-2356-1-git-send-email-hejianet@gmail.com> References: <1530239363-2356-1-git-send-email-hejianet@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 ce95491..2c38080a5 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 -- 1.8.3.1