From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCE8DC433E0 for ; Thu, 2 Jul 2020 14:04:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AC50420890 for ; Thu, 2 Jul 2020 14:04:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729478AbgGBOEE (ORCPT ); Thu, 2 Jul 2020 10:04:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:43480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726343AbgGBOEC (ORCPT ); Thu, 2 Jul 2020 10:04:02 -0400 Received: from gaia (unknown [95.146.230.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 341F920772; Thu, 2 Jul 2020 14:03:58 +0000 (UTC) Date: Thu, 2 Jul 2020 15:03:55 +0100 From: Catalin Marinas To: Anshuman Khandual Cc: linux-mm@kvack.org, Will Deacon , Mark Rutland , Paul Walmsley , Palmer Dabbelt , Tony Luck , Fenghua Yu , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , David Hildenbrand , Mike Rapoport , Michal Hocko , "Matthew Wilcox (Oracle)" , "Kirill A. Shutemov" , Andrew Morton , Dan Williams , Pavel Tatashin , linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-riscv@lists.infradead.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V3 (RESEND) 1/3] mm/sparsemem: Enable vmem_altmap support in vmemmap_populate_basepages() Message-ID: <20200702140355.GE22241@gaia> References: <1592442930-9380-1-git-send-email-anshuman.khandual@arm.com> <1592442930-9380-2-git-send-email-anshuman.khandual@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1592442930-9380-2-git-send-email-anshuman.khandual@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 18, 2020 at 06:45:28AM +0530, Anshuman Khandual wrote: > vmemmap_populate_basepages() is used across platforms to allocate backing > memory for vmemmap mapping. This is used as a standard default choice or > as a fallback when intended huge pages allocation fails. This just creates > entire vmemmap mapping with base pages (PAGE_SIZE). > > On arm64 platforms, vmemmap_populate_basepages() is called instead of the > platform specific vmemmap_populate() when ARM64_SWAPPER_USES_SECTION_MAPS > is not enabled as in case for ARM64_16K_PAGES and ARM64_64K_PAGES configs. > > At present vmemmap_populate_basepages() does not support allocating from > driver defined struct vmem_altmap while trying to create vmemmap mapping > for a device memory range. It prevents ARM64_16K_PAGES and ARM64_64K_PAGES > configs on arm64 from supporting device memory with vmemap_altmap request. > > This enables vmem_altmap support in vmemmap_populate_basepages() unlocking > device memory allocation for vmemap mapping on arm64 platforms with 16K or > 64K base page configs. > > Each architecture should evaluate and decide on subscribing device memory > based base page allocation through vmemmap_populate_basepages(). Hence lets > keep it disabled on all archs in order to preserve the existing semantics. > A subsequent patch enables it on arm64. > > 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: linux-arm-kernel@lists.infradead.org > Cc: linux-ia64@vger.kernel.org > Cc: linux-riscv@lists.infradead.org > Cc: x86@kernel.org > Cc: linux-kernel@vger.kernel.org > Tested-by: Jia He > Acked-by: Will Deacon > Signed-off-by: Anshuman Khandual For arm64: Acked-by: Catalin Marinas