From patchwork Wed Apr 3 04:30:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 10882773 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 5325617E1 for ; Wed, 3 Apr 2019 04:30:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38E6328613 for ; Wed, 3 Apr 2019 04:30:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D30D28750; Wed, 3 Apr 2019 04:30:20 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 D0FCB28613 for ; Wed, 3 Apr 2019 04:30:19 +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: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:In-Reply-To: References:List-Owner; bh=PszZCnYb3u1uDUXL867RkeSl1D2fFLWHqMbsW/EbGEg=; b=i8P X51MChkzjdmYk2lyvrEDSdIA1zALcKzL/Yt3k/TLGr7NOPpR4B5U0gXdnbvdjQVFytpwY2rbbpTWP DQuJ1qs7CAlwJyFPyryEeG5fQGqB5+myZqsbSN/ZrXpo1SjRwzOsH3SNnlYkBe06tsU0aBJ14AYXv qEqp5SnHxKhMnSkkrUFWD7Ivhf5EQCTWfB4cu1YGEJZhzfyPYP3TLQ0jxjBiLCiUrPLi9oWSQTwRj nqMbIvWfZbTyVANjGuYPDWf0yTz2ZRfOd0S/oEbipxKIIzV9Ts30EVZCIPY+8oG0MtaahkiFd7qWH X5B/6swNXBYdaTqAGx52M+ZhK4x/3Wg==; 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 1hBXXW-0003WJ-LU; Wed, 03 Apr 2019 04:30:18 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBXXS-0003Vh-Mi for linux-arm-kernel@lists.infradead.org; Wed, 03 Apr 2019 04:30:16 +0000 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 2E40380D; Tue, 2 Apr 2019 21:30:12 -0700 (PDT) Received: from p8cg001049571a15.arm.com (unknown [10.163.1.97]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id BE65E3F721; Tue, 2 Apr 2019 21:30:06 -0700 (PDT) From: Anshuman Khandual To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, akpm@linux-foundation.org, will.deacon@arm.com, catalin.marinas@arm.com Subject: [PATCH 0/6] arm64/mm: Enable memory hot remove and ZONE_DEVICE Date: Wed, 3 Apr 2019 10:00:00 +0530 Message-Id: <1554265806-11501-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-20190402_213014_750069_ABA95A38 X-CRM114-Status: UNSURE ( 8.99 ) X-CRM114-Notice: Please train this message. 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: mark.rutland@arm.com, mhocko@suse.com, david@redhat.com, robin.murphy@arm.com, cai@lca.pw, pasha.tatashin@oracle.com, logang@deltatee.com, james.morse@arm.com, cpandya@codeaurora.org, arunks@codeaurora.org, dan.j.williams@intel.com, mgorman@techsingularity.net, osalvador@suse.de 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 This series enables memory hot remove on arm64, fixes a memblock removal ordering problem in generic __remove_memory(), enables sysfs memory probe interface on arm64. It also enables ZONE_DEVICE with struct vmem_altmap support. Testing: Tested hot remove on arm64 for all 4K, 16K, 64K page config options with all possible VA_BITS and PGTABLE_LEVELS combinations. Tested ZONE_DEVICE with ARM64_4K_PAGES through a dummy driver. Build tested on non arm64 platforms. I will appreciate if folks can test arch_remove_memory() re-ordering in __remove_memory() on other platforms. Dependency: V5 series in the thread (https://lkml.org/lkml/2019/2/14/1096) will make kernel linear mapping loose pgtable_page_ctor() init. When this happens the proposed functions free_pte|pmd|pud_table() in [PATCH 2/6] will have to stop calling pgtable_page_dtor(). Anshuman Khandual (5): arm64/mm: Enable sysfs based memory hot add interface arm64/mm: Enable memory hot remove arm64/mm: Enable struct page allocation from device memory mm/hotplug: Reorder arch_remove_memory() call in __remove_memory() arm64/mm: Enable ZONE_DEVICE Robin Murphy (1): mm/memremap: Rename and consolidate SECTION_SIZE arch/arm64/Kconfig | 13 +++ arch/arm64/include/asm/pgtable.h | 14 +++ arch/arm64/mm/mmu.c | 242 ++++++++++++++++++++++++++++++++++++++- include/linux/mmzone.h | 1 + kernel/memremap.c | 10 +- mm/hmm.c | 2 - mm/memory_hotplug.c | 3 +- 7 files changed, 271 insertions(+), 14 deletions(-)