From patchwork Tue Mar 31 05:09:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 11466729 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E7025912 for ; Tue, 31 Mar 2020 05:10:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8666820748 for ; Tue, 31 Mar 2020 05:10:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="E4dVmYrD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8666820748 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=Xl6+XrJk47AuvEMM/8KRYpSSwMkpV4b7375kKuQqYuo=; b=E4dVmYrDnTJOx406zUClL5GkWM wYU8A/369E3GXw/jSG8AmUGVbUQxJYdHFIav7IdlvIqCSJszx3qEx8h4nIdmpHCgq39WYUrnDxw5G Vn/8IY7z+8Z0SlmSIplhGYWkkLfbSVz6Nyl0o+dtydzmiDUZOynTuUWkmMN+890K5DmjAGQ8wd8CC gm6PiyE6gIBmgvCOfhKLCTcFqLlDeTlu4vfKBUeKid3cCr+apyL/8OEYCDYPI0n1lZJG/PpBr9ztk eD6U7VMhvGoosvMWYYE19R+K1eTuGGJt1c0RWOO7sP0rtt3Uo3EmWyz/2q+Ibpl44NcJ0EoSShZMG yzjBtCCg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jJ9AX-0004Do-VC; Tue, 31 Mar 2020 05:10:33 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jJ9AM-00045J-1o; Tue, 31 Mar 2020 05:10:24 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 221741FB; Mon, 30 Mar 2020 22:10:18 -0700 (PDT) Received: from p8cg001049571a15.arm.com (unknown [10.163.1.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C8F2F3F71E; Mon, 30 Mar 2020 22:09:57 -0700 (PDT) From: Anshuman Khandual To: linux-mm@kvack.org Subject: [PATCH V3 0/3] arm64: Enable vmemmap mapping from device memory Date: Tue, 31 Mar 2020 10:39:44 +0530 Message-Id: <1585631387-18819-1-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200330_221022_184508_2C92720E X-CRM114-Status: GOOD ( 13.74 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [217.140.110.172 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Michal Hocko , Thomas Gleixner , David Hildenbrand , Peter Zijlstra , Catalin Marinas , Dave Hansen , Paul Mackerras , linux-ia64@vger.kernel.org, linux-riscv@lists.infradead.org, Will Deacon , jgg@mellanox.com, aneesh.kumar@linux.ibm.com, x86@kernel.org, "Matthew Wilcox \(Oracle\)" , Mike Rapoport , Ingo Molnar , Benjamin Herrenschmidt , Fenghua Yu , rcampbell@nvidia.com, Pavel Tatashin , Anshuman Khandual , jglisse@redhat.com, Andy Lutomirski , Paul Walmsley , dan.j.williams@intel.com, linux-arm-kernel@lists.infradead.org, Tony Luck , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , Michael Ellerman , Andrew Morton , robin.murphy@arm.com, "Kirill A. Shutemov" Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org This series enables vmemmap backing memory allocation from device memory ranges on arm64. But before that, it enables vmemmap_populate_basepages() and vmemmap_alloc_block_buf() to accommodate struct vmem_altmap based alocation requests. This series applies after latest (v14) arm64 memory hot remove series (https://lkml.org/lkml/2020/3/3/1746) on Linux 5.6. Pending Question: altmap_alloc_block_buf() does not have any other remaining users in the tree after this change. Should it be converted into a static function and it's declaration be dropped from the header (include/linux/mm.h). Avoided doing so because I was not sure if there are any off-tree users or not. Changes in V3: - Dropped comment from free_hotplug_page_range() per Robin - Modified comment in unmap_hotplug_range() per Robin - Enabled altmap support in vmemmap_alloc_block_buf() per Robin Changes in V2: (https://lkml.org/lkml/2020/3/4/475) - Rebased on latest hot-remove series (v14) adding P4D page table support Changes in V1: (https://lkml.org/lkml/2020/1/23/12) - Added an WARN_ON() in unmap_hotplug_range() when altmap is provided without the page table backing memory being freed Changes in RFC V2: (https://lkml.org/lkml/2019/10/21/11) - Changed the commit message on 1/2 patch per Will - Changed the commit message on 2/2 patch as well - Rebased on arm64 memory hot remove series (v10) RFC V1: (https://lkml.org/lkml/2019/6/28/32) Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Tony Luck Cc: Fenghua Yu Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Cc: David Hildenbrand Cc: Mike Rapoport Cc: Michal Hocko Cc: "Matthew Wilcox (Oracle)" Cc: "Kirill A. Shutemov" Cc: Andrew Morton Cc: Dan Williams Cc: Pavel Tatashin Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: linux-arm-kernel@lists.infradead.org Cc: linux-ia64@vger.kernel.org Cc: linux-riscv@lists.infradead.org Cc: x86@kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Anshuman Khandual (3): mm/sparsemem: Enable vmem_altmap support in vmemmap_populate_basepages() mm/sparsemem: Enable vmem_altmap support in vmemmap_alloc_block_buf() arm64/mm: Enable vmem_altmap support for vmemmap mappings arch/arm64/mm/mmu.c | 59 ++++++++++++++++++++++++++------------- arch/ia64/mm/discontig.c | 2 +- arch/powerpc/mm/init_64.c | 10 +++---- arch/riscv/mm/init.c | 2 +- arch/x86/mm/init_64.c | 12 ++++---- include/linux/mm.h | 8 ++++-- mm/sparse-vmemmap.c | 38 ++++++++++++++++++++----- 7 files changed, 87 insertions(+), 44 deletions(-) Tested-by: Jia He