From patchwork Fri Aug 31 15:19:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Morse X-Patchwork-Id: 10584083 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BD79A14E1 for ; Fri, 31 Aug 2018 15:19:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE31E2793A for ; Fri, 31 Aug 2018 15:19:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0FE22B676; Fri, 31 Aug 2018 15:19:55 +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,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 EE7402B66C for ; Fri, 31 Aug 2018 15:19:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D669D6B579E; Fri, 31 Aug 2018 11:19:53 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D15356B579F; Fri, 31 Aug 2018 11:19:53 -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 C04486B57A0; Fri, 31 Aug 2018 11:19:53 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi0-f70.google.com (mail-oi0-f70.google.com [209.85.218.70]) by kanga.kvack.org (Postfix) with ESMTP id 93A676B579E for ; Fri, 31 Aug 2018 11:19:53 -0400 (EDT) Received: by mail-oi0-f70.google.com with SMTP id w194-v6so11354273oiw.5 for ; Fri, 31 Aug 2018 08:19:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id; bh=C3OWLPMqvaNlzIBVFAZ3SRdvyc5SylugWBGnndqVSPQ=; b=bZck5342w8v/VmZe+NwEXOtk7LhFlnr3TnMg31jAwXPE4JgRN6R/LCaUmFPyZBzTIe D2mUN9JqgHQiO8TsNRun1DSKsuPMKHMask+MOHTVGdLUY95W/TOzbRgVJXsHzn1JFyjY iOqmFXzMwBS9PE2be4Kz2AMZEjn+pNh4Jkc7lSYHW6x1p8zbKf+J5sJBNeDD2peb15kI JuS7hpLKKU1cozda793MmqgUAzs26hfA9lVe6OpReSLqJeR6sPenVgIvDxMQ+Glx7o5j ezD9cKqErzBuB2IHF9zSuqiTPUeEQmdWew5CyL/pHdto1Y2RedjdWcWupD19k3r53nJR l8XQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of james.morse@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=james.morse@arm.com X-Gm-Message-State: APzg51A4CPBGWPgnMuNN23WoonKRLkLmDmGTesU4bdgPcx/fy134Q10j Cc5+xPzh2zCZ7uyoL4dJ3WK8+NtdcNniFeGVwd+QNTDRkYBCa3wdpL2a9k/s5Ihy1Jfxp57eY/f Bvs01ibdbk/B/UgnlWkfxxj0aLw1wUG+QjT7wt0pBV4bTLNYqvJzrp8HU7esDFngfIA== X-Received: by 2002:aca:51d8:: with SMTP id f207-v6mr7371012oib.59.1535728793292; Fri, 31 Aug 2018 08:19:53 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYq84BPPsY8vM15j6VguOXh+3YJFt5bhmZIo7bQZhNbjVzL7JzeECT82ACl5yTFbtZSjUkl X-Received: by 2002:aca:51d8:: with SMTP id f207-v6mr7370933oib.59.1535728792130; Fri, 31 Aug 2018 08:19:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535728792; cv=none; d=google.com; s=arc-20160816; b=TXWnOCr1I/oFqX3i7fcnOkz+br1JCtFrbGXd4X5UcQ2yw9auOjX/IWhNXm9jlig/Oy e6Y3eC2IWhps/4xfLPh/gkTM8Q5M4knq+YnOgWedZrWVSEP1W8N6txWllCYW+nzsN4au wAkfVo6tu1XJ2CLqP/jemRfaKtqPNypdZZcEUbA7UllI/4XMVRpwEzXkzJ+IIyQ3coLO y+unG2S9yg7z0ft7//EDxTxHw6UWvbSvaGd/ToXBo9MyDNXE+JU1//U1QVYwgn36iH/v V2qxkKxnarSo3uW6wCQmn2YaAlJB4n61WIFa9XKqu25L5UEUESOBRLv2NygqFVyQzclV jRIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=C3OWLPMqvaNlzIBVFAZ3SRdvyc5SylugWBGnndqVSPQ=; b=V0/zrVbBmmV4OKoEzLatBiLdh8v+jVlYDGsaejQgaOx0m7INs8eNjfbYju+UmucQio Vw5FBeEE2NKQfO0K3Vv4E6r4SXXDlSDqzBgddy3lgasf8MdSLxpz0MQkV6dVNtw/GxHi tXl7i3aGCFBtMP6QEaDfjN+HIUADvvx7KnLWLU2LsfOTm1LMDwf7hWhCXEncx+dr/+i7 Mm7wLiaL43cC+YE7F0W4EtHj8CSJSpDfe9d4b+q+QZA/MLuX0Hq1a0eUKUPnruV2AGUB BdkNbHX8O60qUHYsCYbuoeF7cf3qpIOz25aC2Sp6ZKujNw81CHAKx3FkWS7CQuA+0MVp x9ZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of james.morse@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=james.morse@arm.com Received: from foss.arm.com (foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id t194-v6si7525773oif.388.2018.08.31.08.19.51 for ; Fri, 31 Aug 2018 08:19:52 -0700 (PDT) Received-SPF: pass (google.com: domain of james.morse@arm.com designates 217.140.101.70 as permitted sender) client-ip=217.140.101.70; Authentication-Results: mx.google.com; spf=pass (google.com: domain of james.morse@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=james.morse@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 662567A9; Fri, 31 Aug 2018 08:19:51 -0700 (PDT) Received: from melchizedek.Emea.Arm.com (melchizedek.Emea.Arm.com [10.4.12.81]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7A4EC3F5BD; Fri, 31 Aug 2018 08:19:50 -0700 (PDT) From: James Morse To: linux-arm-kernel@lists.infradead.org Cc: Will Deacon , Catalin Marinas , linux-mm@kvack.org Subject: [PATCH] arm64: Kconfig: Remove ARCH_HAS_HOLES_MEMORYMODEL Date: Fri, 31 Aug 2018 16:19:43 +0100 Message-Id: <20180831151943.9281-1-james.morse@arm.com> X-Mailer: git-send-email 2.18.0 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 include/linux/mmzone.h describes ARCH_HAS_HOLES_MEMORYMODEL as relevant when parts the memmap have been free()d. This would happen on systems where memory is smaller than a sparsemem-section, and the extra struct pages are expensive. pfn_valid() on these systems returns true for the whole sparsemem-section, so an extra memmap_valid_within() check is needed. On arm64 we have nomap memory, so always provide pfn_valid() to test for nomap pages. This means ARCH_HAS_HOLES_MEMORYMODEL's extra checks are already rolled up into pfn_valid(). Remove it. Signed-off-by: James Morse Acked-by: Will Deacon --- arch/arm64/Kconfig | 5 +---- arch/arm64/include/asm/page.h | 2 -- arch/arm64/mm/init.c | 2 -- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 1b1a0e95c751..6082d47bfc32 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -769,9 +769,6 @@ source kernel/Kconfig.hz config ARCH_SUPPORTS_DEBUG_PAGEALLOC def_bool y -config ARCH_HAS_HOLES_MEMORYMODEL - def_bool y if SPARSEMEM - config ARCH_SPARSEMEM_ENABLE def_bool y select SPARSEMEM_VMEMMAP_ENABLE @@ -786,7 +783,7 @@ config ARCH_FLATMEM_ENABLE def_bool !NUMA config HAVE_ARCH_PFN_VALID - def_bool ARCH_HAS_HOLES_MEMORYMODEL || !SPARSEMEM + def_bool y config HW_PERF_EVENTS def_bool y diff --git a/arch/arm64/include/asm/page.h b/arch/arm64/include/asm/page.h index 60d02c81a3a2..c88a3cb117a1 100644 --- a/arch/arm64/include/asm/page.h +++ b/arch/arm64/include/asm/page.h @@ -37,9 +37,7 @@ extern void clear_page(void *to); typedef struct page *pgtable_t; -#ifdef CONFIG_HAVE_ARCH_PFN_VALID extern int pfn_valid(unsigned long); -#endif #include diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 787e27964ab9..3cf87341859f 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -284,7 +284,6 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max) #endif /* CONFIG_NUMA */ -#ifdef CONFIG_HAVE_ARCH_PFN_VALID int pfn_valid(unsigned long pfn) { phys_addr_t addr = pfn << PAGE_SHIFT; @@ -294,7 +293,6 @@ int pfn_valid(unsigned long pfn) return memblock_is_map_memory(addr); } EXPORT_SYMBOL(pfn_valid); -#endif #ifndef CONFIG_SPARSEMEM static void __init arm64_memory_present(void)