3

What does this output represent after doing cat /proc/vmallocinfo. I know, this gives mapping of virtual address space of kernel. But want to have in-depth understanding.

Questions

  • What are actual allocation done by vmalloc()?
  • Why multiple times allocations are seen from n_tty_open?
  • Why there are gaps between two allocations like:

    • 0xffffc90004000000-0xffffc90005001000 16781312 pci_iomap_range+0x66/0x80 phys=e0000000 ioremap

    • 0xffffe8ffffc00000-0xffffe8ffffe00000 2097152 pcpu_get_vm_areas+0x0/0x570 vmalloc

and any other resource which will clarify my doubt:

0xffffc90000000000-0xffffc90000004000   16384 acpi_os_map_iomem+0xf6/0x154 phys=bfff0000 ioremap
0xffffc90000004000-0xffffc90000405000 4198400 alloc_large_system_hash+0x17a/0x238 pages=1024 vmalloc vpages N0=1024
0xffffc90000405000-0xffffc90000408000   12288 alloc_large_system_hash+0x17a/0x238 pages=2 vmalloc N0=2
0xffffc90000408000-0xffffc90000609000 2101248 alloc_large_system_hash+0x17a/0x238 pages=512 vmalloc N0=512
0xffffc90000609000-0xffffc9000061a000   69632 alloc_large_system_hash+0x17a/0x238 pages=16 vmalloc N0=16
0xffffc9000061a000-0xffffc9000062b000   69632 alloc_large_system_hash+0x17a/0x238 pages=16 vmalloc N0=16
0xffffc9000062b000-0xffffc9000062d000    8192 bpf_prog_alloc+0x36/0xa0 pages=1 vmalloc N0=1
0xffffc9000062d000-0xffffc9000066e000  266240 alloc_large_system_hash+0x17a/0x238 pages=64 vmalloc N0=64
0xffffc9000066e000-0xffffc900006ef000  528384 alloc_large_system_hash+0x17a/0x238 pages=128 vmalloc N0=128
0xffffc900006ef000-0xffffc90000700000   69632 alloc_large_system_hash+0x17a/0x238 pages=16 vmalloc N0=16
0xffffc90000700000-0xffffc90000711000   69632 alloc_large_system_hash+0x17a/0x238 pages=16 vmalloc N0=16
0xffffc90000711000-0xffffc90000716000   20480 alloc_large_system_hash+0x17a/0x238 pages=4 vmalloc N0=4
0xffffc90000716000-0xffffc90000718000    8192 bpf_prog_alloc+0x36/0xa0 pages=1 vmalloc N0=1
0xffffc90000718000-0xffffc9000071b000   12288 zs_cpu_notifier+0x49/0x90 ioremap
0xffffc9000071b000-0xffffc9000071d000    8192 bpf_prog_alloc+0x36/0xa0 pages=1 vmalloc N0=1
0xffffc9000071d000-0xffffc9000071f000    8192 bpf_prog_alloc+0x36/0xa0 pages=1 vmalloc N0=1
0xffffc9000071f000-0xffffc90000721000    8192 bpf_prog_alloc+0x36/0xa0 pages=1 vmalloc N0=1
0xffffc90000721000-0xffffc90000723000    8192 bpf_prog_alloc+0x36/0xa0 pages=1 vmalloc N0=1
0xffffc90000723000-0xffffc90000725000    8192 bpf_prog_alloc+0x36/0xa0 pages=1 vmalloc N0=1
0xffffc90000725000-0xffffc90000727000    8192 bpf_prog_alloc+0x36/0xa0 pages=1 vmalloc N0=1
0xffffc90000727000-0xffffc90000729000    8192 bpf_prog_alloc+0x36/0xa0 pages=1 vmalloc N0=1
0xffffc9000072b000-0xffffc9000072f000   16384 n_tty_open+0x19/0xe0 pages=3 vmalloc N0=3
0xffffc90000730000-0xffffc90000733000   12288 pci_iomap_range+0x66/0x80 phys=f0806000 ioremap
0xffffc90000733000-0xffffc90000737000   16384 n_tty_open+0x19/0xe0 pages=3 vmalloc N0=3
0xffffc90000737000-0xffffc9000073b000   16384 n_tty_open+0x19/0xe0 pages=3 vmalloc N0=3
0xffffc9000073b000-0xffffc9000073f000   16384 n_tty_open+0x19/0xe0 pages=3 vmalloc N0=3
0xffffc9000073f000-0xffffc90000741000    8192 bpf_prog_alloc+0x36/0xa0 pages=1 vmalloc N0=1
0xffffc90000741000-0xffffc90000745000   16384 e1000_setup_all_tx_resources+0x97/0x550 [e1000] pages=3 vmalloc N0=3
0xffffc90000745000-0xffffc90000747000    8192 e1000_setup_all_rx_resources+0xa6/0x560 [e1000] pages=1 vmalloc N0=1
0xffffc90000747000-0xffffc9000074b000   16384 n_tty_open+0x19/0xe0 pages=3 vmalloc N0=3
1
1
  • vmalloc() will allocate non-contiguous physical pages and mapping them to a contiguous virtual address region. These vmalloc virtual address are limited in vmalloc area of kernel space. (While in x86_64 platform is start from 0xffffc90000000000UL as you show the infomation)
  • Because the n_tty_open function use vmalloc to allocate for struct n_tty_data. You can check this in kernel source code.
  • Each vmalloc region use one page gap to protect against overruns.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.