]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: Do not defer reserve_crashkernel() for platforms with no DMA memory zones
authorVijay Balakrishna <vijayb@linux.microsoft.com>
Wed, 2 Mar 2022 17:38:09 +0000 (09:38 -0800)
committerWill Deacon <will@kernel.org>
Tue, 8 Mar 2022 10:22:33 +0000 (10:22 +0000)
commit1ab1672115930b5616683903359630bf11fe0e94
treea1d2a3396f579935b8f8e1dd33900be684e09030
parentb2ddd76ffefcba989aea5b1918791515931d918b
arm64: Do not defer reserve_crashkernel() for platforms with no DMA memory zones

The following patches resulted in deferring crash kernel reservation to
mem_init(), mainly aimed at platforms with DMA memory zones (no IOMMU),
in particular Raspberry Pi 4.

commit cc78e6f0e761 ("arm64: use both ZONE_DMA and ZONE_DMA32")
commit ec7cf4b10e89 ("arm64: mm: Set ZONE_DMA size based on devicetree's dma-ranges")
commit 6b719e93188d ("arm64: mm: Move reserve_crashkernel() into mem_init()")
commit 9e846c161788 ("arm64: Force NO_BLOCK_MAPPINGS if crashkernel reservation is required")

Above changes introduced boot slowdown due to linear map creation for
all the memory banks with NO_BLOCK_MAPPINGS, see discussion[1].  The proposed
changes restore crash kernel reservation to earlier behavior thus avoids
slow boot, particularly for platforms with IOMMU (no DMA memory zones).

Tested changes to confirm no ~150ms boot slowdown on our SoC with IOMMU
and 8GB memory.  Also tested with ZONE_DMA and/or ZONE_DMA32 configs to confirm
no regression to deferring scheme of crash kernel memory reservation.
In both cases successfully collected kernel crash dump.

[1] https://lore.kernel.org/all/9436d033-579b-55fa-9b00-6f4b661c2dd7@linux.microsoft.com/

Signed-off-by: Vijay Balakrishna <vijayb@linux.microsoft.com>
Cc: stable@vger.kernel.org
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Link: https://lore.kernel.org/r/1646242689-20744-1-git-send-email-vijayb@linux.microsoft.com
[will: Add #ifdef CONFIG_KEXEC_CORE guards to fix 'crashk_res' references in allnoconfig build]
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/mm/init.c
arch/arm64/mm/mmu.c