Open fengggli opened 5 years ago
(py36) lifen@sievert(:):~/Workspace/comanche$pmap -X 7471
7471: /home/lifen/Workspace/vagrantvm/vagrant-ubuntu18-spdk1810/comanche/build/src/components/store/nvmestore/testing/mcas-nvmestore/test-mcas-nvmestore --pci 20:00.0
pmap: ERROR: inconsistent detail field in smaps file, line:
Size: 18856 kB
https://github.com/fengggli/spdk/issues/1 This is also how spdk update the dma mapping to kernel through vfio:
157 ret = ioctl(g_vfio.fd, VFIO_IOMMU_MAP_DMA, &dma_map->map); │ linux-vdso.so.1 => (0x00007ffd79d12000)
(gdb) bt │ libcunit.so.1 => /usr/lib/x86_64-linux-gnu/libcunit.so.1 (0x00007efdda798000)
#0 vtophys_iommu_map_dma (size=2097152, iova=30064771072, vaddr=30064771072) at vtophys.c:157 │ libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007efdda57b000)
#1 spdk_vtophys_notify (cb_ctx=<optimized out>, map=0x7fdfe75e7010, action=SPDK_MEM_MAP_NOTIFY_REGISTER, │ libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007efdda1b1000)
vaddr=0x700000000, len=2097152) at vtophys.c:372 │ /lib64/ld-linux-x86-64.so.2 (0x00007efdda9a7000)
#2 0x00007ffff74d478c in spdk_mem_register (vaddr=0x700000000, len=<optimized out>) at memory.c:360 │(py36) lifen@sievert(:):~/Workspace/comanche$ls
#3 0x00000000004054c4 in Main::run (this=0x627420) │-.002t.class CHANGELOG.md cscope.files -.d Doxyfile.in LICENSE README.md tools
at /home/lifen/Workspace/comanche/src/components/store/nvmestore/testing/mcas-nvmestore/testcli.cc:209 │apps CMakeLists.txt cscope.in.out deployment first-time.sh mcas src
#4 0x0000000000405909 in main (argc=3, argv=0x7fffffffe618) │build compile_commands.json cscope.out deps gtags.files mk testing
at /home/lifen/Workspace/comanche/src/components/store/nvmestore/testing/mcas-nvmestore/testcli.cc:262
Some docs about vfio: https://lwn.net/Articles/474088/ so when vfio is enabled, do different processes has the same view of "physical addresses"? if not, filling page table with physical addresses is meaningless!
~~I shall also read this (https://github.com/torvalds/linux/blob/master/Documentation/vfio.txt) Also a video(https://www.youtube.com/watch?v=WFkdTFTOTpA) and discussion(https://www.redhat.com/archives/vfio-users/2018-February/msg00010.html)~~ See https://github.com/fengggli/comanche/issues/8 for more details of vfio
virtual address is not registered in iommu, i needs to look into why the iocontrol doesn't work! Search using "spdk_mem_register site:https://lists.01.org/pipermail/spdk/"
spdk can be rebuild and reinstalled with
make DPDK_DIR=/home/lifen/Workspace/comanche/build/dist//share/dpdk/x86_64-native-linuxapp-gcc/ CONFIG_RDMA=y
make install DESTDIR=/home/lifen/Workspace/comanche/build/dist/ CONFIG_PREFIX=""
From https://github.com/libhugetlbfs/libhugetlbfs/blob/master/HOWTO By default, when libhugetlbfs uses anonymous, unlinked hugetlbfs files to store remapped program segment data. This means that if the same program is started multiple times using hugepage segments, multiple huge pages will be used to store the same program data.
[ +0.000000] user: [mem 0x00000000fed1c000-0x00000000fed1ffff] reserved
[ +0.000000] user: [mem 0x00000000ff800000-0x00000000ffffffff] reserved
[ +0.000000] user: [mem 0x0000000100000000-0x00000007ffffffff] usable
[ +0.000000] user: [mem 0x0000000800000000-0x000000087fffffff] persistent (type 12)
[ +0.000000] user: [mem 0x0000000880000000-0x00000008ffffffff] persistent (type 12)
[ +0.000000] user: [mem 0x0000000900000000-0x000000107fffffff] usable
VM_RESERVED changed to VM_DONTEXPAND | VM_DONTDUMP
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=547b1e81afe3119f7daf702cc03b158495535a25
pg_reserved in pmem and mmio https://lkml.org/lkml/2018/12/14/290
pgprot_noncached(https://elixir.bootlin.com/linux/v4.15/source/arch/x86/include/asm/pgtable.h#L12) will set _PAGE_PCD in pte
/* page cache disabled */
PageFlag is set here(has pg_reserved): https://elixir.bootlin.com/linux/v4.15/source/include/linux/page-flags.h#L203
references: https://elixir.bootlin.com/linux/v4.15/source/drivers/video/fbdev/au1100fb.c#L486
Trying:
In ( https://www.kernel.org/doc/gorman/html/understand/understand005.html):
PG_reserved | This is set for pages that can never be swapped out. It is set by the boot memory allocator (See Chapter 5) for pages allocated during system startup. Later it is used to flag empty pages or ones that do not even exist |
---|
mlx kernel rdma driver:
Problem is post in here https://www.redhat.com/archives/vfio-users/2019-July/msg00005.html I will come back when I got more useful info from them. The current status is:
Previously I had tried to use newer dpdk(https://github.com/fengggli/dpdk/issues/1), but failed