Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\setup.c Create Date:2022-07-28 07:39:58
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:reserve_crashkernel

Proto:static void __init reserve_crashkernel(void)

Type:void

Parameter:Nothing

545  bool high = false
548  total_mem = memblock_phys_mem_size()
551  ret = parse_crashkernel(boot_command_line, total_mem, & crash_size, & crash_base)
552  If ret != 0 || crash_size <= 0 Then
554  ret = parse_crashkernel_high(boot_command_line, total_mem, & crash_size, & crash_base)
556  If ret != 0 || crash_size <= 0 Then Return
558  high = true
561  If xen_pv_domain() Then
562  pr_info("Ignoring crashkernel for a Xen PV domain\n")
563  Return
567  If Not crash_base Then
576  If Not high Then crash_base = memblock_find_in_range(16M alignment for crash kernel regions , Keep the crash kernel below this limit.* On 32 bits earlier kernels would limit the kernel to the low 512 MiB* due to mapping restrictions.* On 64bit, kdump kernel need be restricted to be under 64TB, which is, crash_size, 16M alignment for crash kernel regions )
580  If Not crash_base Then crash_base = memblock_find_in_range(16M alignment for crash kernel regions , CRASH_ADDR_HIGH_MAX, crash_size, 16M alignment for crash kernel regions )
584  If Not crash_base Then
585  pr_info("crashkernel reservation failed - No suitable area found.\n")
586  Return
588  Else
591  start = memblock_find_in_range(crash_base, crash_base + crash_size, crash_size, 1 << 20)
594  If start != crash_base Then
595  pr_info("crashkernel reservation failed - memory is in use.\n")
596  Return
599  ret = memblock_reserve(crash_base, crash_size)
600  If ret Then
601  pr_err("%s: Error reserving crashkernel memblock.\n", __func__)
602  Return
605  If crash_base >= 1ULL << 32 && reserve_crashkernel_low() Then
606  memblock_free(crash_base, crash_size)
607  Return
610  pr_info("Reserving %ldMB of memory at %ldMB for crashkernel (System RAM: %ldMB)\n", (unsignedlong)(crash_size >> 20), (unsignedlong)(crash_base >> 20), (unsignedlong)(total_mem >> 20))
615  start = crash_base
616  end = crash_base + crash_size - 1
617  insert_resource( & iomem_resource, & Location of a reserved region to hold the crash kernel.)
Caller
NameDescribe
setup_archsetup_arch - architecture-specific boot-time initializations* Note: On x86_64, fixmaps are ready for use even before this is called.