• Anshuman Khandual's avatar
    arm64/mm: enable vmem_altmap support for vmemmap mappings · eee07935
    Anshuman Khandual authored
    Device memory ranges when getting hot added into ZONE_DEVICE, might
    require their vmemmap mapping's backing memory to be allocated from their
    own range instead of consuming system memory.  This prevents large system
    memory usage for potentially large device memory ranges.  Device driver
    communicates this request via vmem_altmap structure.  Architecture needs
    to take this request into account while creating and tearing down vemmmap
    mappings.
    
    This enables vmem_altmap support in vmemmap_populate() and vmemmap_free()
    which includes vmemmap_populate_basepages() used for ARM64_16K_PAGES and
    ARM64_64K_PAGES configs.
    Signed-off-by: default avatarAnshuman Khandual <anshuman.khandual@arm.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Tested-by: default avatarJia He <justin.he@arm.com>
    Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
    Cc: Will Deacon <will@kernel.org>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Steve Capper <steve.capper@arm.com>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: Yu Zhao <yuzhao@google.com>
    Cc: Hsin-Yi Wang <hsinyi@chromium.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Dan Williams <dan.j.williams@intel.com>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: Fenghua Yu <fenghua.yu@intel.com>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
    Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
    Cc: Michael Ellerman <mpe@ellerman.id.au>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: Mike Rapoport <rppt@linux.ibm.com>
    Cc: Palmer Dabbelt <palmer@dabbelt.com>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Paul Walmsley <paul.walmsley@sifive.com>
    Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Robin Murphy <robin.murphy@arm.com>
    Cc: Tony Luck <tony.luck@intel.com>
    Link: http://lkml.kernel.org/r/1594004178-8861-4-git-send-email-anshuman.khandual@arm.comSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    eee07935
mmu.c 38.3 KB