Hi Lianbo
>
> With enough continuous physical memory we can have 1GB block. This have
> been seen only in linear mapping region in kernel space. I have only
> verified this for VM_L3_4K.
>
> reference: alloc_init_pud(), use_1G_block() [arch/arm64/mm/mmu.c]
>
For this situation, do you know how to reproduce it easily? Can you share
your steps in detail?
I can try, one requirement is that you have memory aligned at 1 GB and
size is at least 1 GB. Lets assume we have vmcore with physical memory
at 0x100000000 (1 GB aligned) with size at least 1 GB. Then from crash we
could do:
crash> ptov 100000000
VIRTUAL PHYSICAL
ffffffe900000000 100000000
crash> vtop ffffffe900000000
VIRTUAL PHYSICAL
ffffffe900000000 100000000
PAGE DIRECTORY: ffffff990f66c000
PGD: ffffff990f66cd20 => 68000100000711
PAGE: 100000000 (1GB)
PTE PHYSICAL FLAGS
68000100000711 100000000 (VALID|SHARED|AF|PXN|UXN)
PAGE PHYSICAL MAPPING INDEX CNT FLAGS
ffffffbfa4000000 100000000 ffffffe97de59090 fe 2 20054
uptodate,lru,workingset,mappedtodisk
I hope that helps.
Regards
Johan
BTW: I did the test, but I didn't enter into the kernel code path
because
that condition was not met.
# dmesg|grep -i huge
[ 0.000000] Kernel command line: BOOT_IMAGE=(hd0,gpt2)/vmlinuz-5.12.0-rc7+
root=/dev/mapper/rhel_gigabyte--r120--20-root ro arm->smmu.disable_bypass=n
initcall_blacklist=gtdt_sbsa_gwdt_init iommu.passthrough=1 crashkernel=512M hugepagesz=1G
hugepages=6 >debug_pagealloc=on rd.lvm.lv=rhel_gigabyte-r120-20/root
rd.lvm.lv=rhel_gigabyte-r120-20/swap
[ 2.620634] HugeTLB registered 1.00 GiB page size, pre-allocated 6 pages
Thanks.
Lianbo