Hi,
On 06/13/22 at 04:09pm, Zhen Lei wrote:
If the crashkernel has both high memory above DMA zones and low memoryUgh, this looks a little ugly, honestly.
in DMA zones, kexec always loads the content such as Image and dtb to the
high memory instead of the low memory. This means that only high memory
requires write protection based on page-level mapping. The allocation of
high memory does not depend on the DMA boundary. So we can reserve the
high memory first even if the crashkernel reservation is deferred.
This means that the block mapping can still be performed on other kernel
linear address spaces, the TLB miss rate can be reduced and the system
performance will be improved.
If that's for sure arm64 can't split large page mapping of linear
region, this patch is one way to optimize linear mapping. Given kdump
setting is necessary on arm64 server, the booting speed is truly
impacted heavily.
However, I would suggest letting it as is with below reasons:
1) The code will complicate the crashkernel reservatoin code which
is already difficult to understand.
2) It can only optimize the two cases, first is CONFIG_ZONE_DMA|DMA32
disabled, the other is crashkernel=,high is specified. While both
two cases are corner case, most of systems have CONFIG_ZONE_DMA|DMA32
enabled, and most of systems have crashkernel=xM which is enough.
Having them optimized won't bring benefit to most of systems.
3) Besides, the crashkernel=,high can be handled earlier because
arm64 alwasys have memblock.bottom_up == false currently, thus we
don't need worry arbout the lower limit of crashkernel,high
reservation for now. If memblock.bottom_up is set true in the future,
this patch doesn't work any more.
...
crash_base = memblock_phys_alloc_range(crash_size, CRASH_ALIGN,
crash_base, crash_max);
So, in my opinion, we can leave the current NON_BLOCK|SECT mapping as
is caused by crashkernel reserving, since no regression is brought.
And meantime, turning to check if there's any way to make the contiguous
linear mapping and later splitting work. The patch 4, 5 in this patchset
doesn't make much sense to me, frankly speaking.
Thanks
Baoquan