diff options
author | Jisheng Zhang <jszhang@marvell.com> | 2016-06-08 15:53:46 +0800 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2016-06-21 16:54:53 +0100 |
commit | b67a8b29df7e6410c605c2759707c96512b15578 (patch) | |
tree | 8917ea75962d34806f07f38d1281b70b1871c1cd /arch/arm64/mm/init.c | |
parent | 83ce0efc12811c1b11f71a8164949ff4f6117054 (diff) | |
download | lwn-b67a8b29df7e6410c605c2759707c96512b15578.tar.gz lwn-b67a8b29df7e6410c605c2759707c96512b15578.zip |
arm64: mm: only initialize swiotlb when necessary
we only initialize swiotlb when swiotlb_force is true or not all system
memory is DMA-able, this trivial optimization saves us 64MB when
swiotlb is not necessary.
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/mm/init.c')
-rw-r--r-- | arch/arm64/mm/init.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index d45f8627012c..7d25b4d00677 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -403,7 +403,8 @@ static void __init free_unused_memmap(void) */ void __init mem_init(void) { - swiotlb_init(1); + if (swiotlb_force || max_pfn > (arm64_dma_phys_limit >> PAGE_SHIFT)) + swiotlb_init(1); set_max_mapnr(pfn_to_page(max_pfn) - mem_map); |