• Xunlei Pang's avatar
    x86/mm: Add support for gbpages to kernel_ident_mapping_init() · 66aad4fd
    Xunlei Pang authored
    Kernel identity mappings on x86-64 kernels are created in two
    ways: by the early x86 boot code, or by kernel_ident_mapping_init().
    
    Native kernels (which is the dominant usecase) use the former,
    but the kexec and the hibernation code uses kernel_ident_mapping_init().
    
    There's a subtle difference between these two ways of how identity
    mappings are created, the current kernel_ident_mapping_init() code
    creates identity mappings always using 2MB page(PMD level) - while
    the native kernel boot path also utilizes gbpages where available.
    
    This difference is suboptimal both for performance and for memory
    usage: kernel_ident_mapping_init() needs to allocate pages for the
    page tables when creating the new identity mappings.
    
    This patch adds 1GB page(PUD level) support to kernel_ident_mapping_init()
    to address these concerns.
    
    The primary advantage would be better TLB coverage/performance,
    because we'd utilize 1GB TLBs instead of 2MB ones.
    
    It is also us...
    66aad4fd
hibernate_64.c 8.08 KB