? 2020/1/9 ??9:48, David Hildenbrand ??:> Ping, > > I'd love to get some feedback on > > a) The remaining MM bits from MM folks (especially, patch #6 and #8). > b) The general virtio infrastructure (esp. uapi in patch #2) from virtio > folks. > > I'm planning to send a proper v1 (!RFC) once I have all necessary MM > acks. In the meanwhile, I will do more testing and minor reworks (e.g., > fix !CONFIG_NUMA compilation).Hi David, Thanks for your work! I am trying your https://github.com/davidhildenbrand/linux.git virtio-mem-v5 which works fine for me, but just a 'DMA error' happens when a vm start with less than 2GB memory, Do I missed sth? Thanks Alex (qemu) qom-set vm0 requested-size 1g (qemu) [ 26.560026] virtio_mem virtio0: plugged size: 0x0 [ 26.560648] virtio_mem virtio0: requested size: 0x40000000 [ 26.561730] systemd-journald[167]: no db file to read /run/udev/data/+virtio:virtio0: No such file or directory [ 26.563138] systemd-journald[167]: no db file to read /run/udev/data/+virtio:virtio0: No such file or directory [ 26.569122] Built 1 zonelists, mobility grouping on. Total pages: 513141 [ 26.570039] Policy zone: Normal (qemu) [ 32.175838] e1000 0000:00:03.0: swiotlb buffer is full (sz: 81 bytes), total 0 (slots), used 0 (slots) [ 32.176922] e1000 0000:00:03.0: TX DMA map failed [ 32.177488] e1000 0000:00:03.0: swiotlb buffer is full (sz: 81 bytes), total 0 (slots), used 0 (slots) [ 32.178535] e1000 0000:00:03.0: TX DMA map failed my qemu command is like this: qemu-system-x86_64 --enable-kvm \ -m 2G,maxmem=16G -kernel /root/linux-next/$1/arch/x86/boot/bzImage \ -smp 4 \ -append "earlyprintk=ttyS0 root=/dev/sda1 console=ttyS0 debug psi=1 nokaslr ignore_loglevel" \ -hda /root/CentOS-7-x86_64-Azure-1703.qcow2 \ -net user,hostfwd=tcp::2222-:22 -net nic -s \ -object memory-backend-ram,id=mem0,size=3G \ -device virtio-mem-pci,id=vm0,memdev=mem0,node=0,requested-size=0M \ --nographic
David Hildenbrand
2020-Jun-05 09:08 UTC
[PATCH RFC v4 00/13] virtio-mem: paravirtualized memory
On 05.06.20 10:55, Alex Shi wrote:> > > ? 2020/1/9 ??9:48, David Hildenbrand ??: >> Ping, >> >> I'd love to get some feedback on >> >> a) The remaining MM bits from MM folks (especially, patch #6 and #8). >> b) The general virtio infrastructure (esp. uapi in patch #2) from virtio >> folks. >> >> I'm planning to send a proper v1 (!RFC) once I have all necessary MM >> acks. In the meanwhile, I will do more testing and minor reworks (e.g., >> fix !CONFIG_NUMA compilation). > > > Hi David, > > Thanks for your work! > > I am trying your https://github.com/davidhildenbrand/linux.git virtio-mem-v5 > which works fine for me, but just a 'DMA error' happens when a vm start with > less than 2GB memory, Do I missed sth?Please use the virtio-mem-v4 branch for now, v5 is still under construction (and might be scrapped completely if v4 goes upstream as is). Looks like a DMA issue. Your're hotplugging 1GB, which should not really eat too much memory. There was a similar issue reported by Hui in [1], which boiled down to wrong usage of the swiotlb parameter. In such cases you should always try to reproduce with hotplug of a sam-sized DIMM. E.g., hotplugging a 1GB DIMM should result in the same issue. What does your .config specify for CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE? I'll try to reproduce with v4 briefly. [1] https://lkml.kernel.org/r/9708F43A-9BD2-4377-8EE8-7FB1D95C6F69 at linux.alibaba.com> > Thanks > Alex > > > (qemu) qom-set vm0 requested-size 1g > (qemu) [ 26.560026] virtio_mem virtio0: plugged size: 0x0 > [ 26.560648] virtio_mem virtio0: requested size: 0x40000000 > [ 26.561730] systemd-journald[167]: no db file to read /run/udev/data/+virtio:virtio0: No such file or directory > [ 26.563138] systemd-journald[167]: no db file to read /run/udev/data/+virtio:virtio0: No such file or directory > [ 26.569122] Built 1 zonelists, mobility grouping on. Total pages: 513141 > [ 26.570039] Policy zone: Normal > > (qemu) [ 32.175838] e1000 0000:00:03.0: swiotlb buffer is full (sz: 81 bytes), total 0 (slots), used 0 (slots) > [ 32.176922] e1000 0000:00:03.0: TX DMA map failed > [ 32.177488] e1000 0000:00:03.0: swiotlb buffer is full (sz: 81 bytes), total 0 (slots), used 0 (slots) > [ 32.178535] e1000 0000:00:03.0: TX DMA map failed > > my qemu command is like this: > qemu-system-x86_64 --enable-kvm \ > -m 2G,maxmem=16G -kernel /root/linux-next/$1/arch/x86/boot/bzImage \ > -smp 4 \ > -append "earlyprintk=ttyS0 root=/dev/sda1 console=ttyS0 debug psi=1 nokaslr ignore_loglevel" \ > -hda /root/CentOS-7-x86_64-Azure-1703.qcow2 \ > -net user,hostfwd=tcp::2222-:22 -net nic -s \ > -object memory-backend-ram,id=mem0,size=3G \ > -device virtio-mem-pci,id=vm0,memdev=mem0,node=0,requested-size=0M \ > --nographic > >-- Thanks, David / dhildenb
David Hildenbrand
2020-Jun-05 09:36 UTC
[PATCH RFC v4 00/13] virtio-mem: paravirtualized memory
On 05.06.20 11:08, David Hildenbrand wrote:> On 05.06.20 10:55, Alex Shi wrote: >> >> >> ? 2020/1/9 ??9:48, David Hildenbrand ??: >>> Ping, >>> >>> I'd love to get some feedback on >>> >>> a) The remaining MM bits from MM folks (especially, patch #6 and #8). >>> b) The general virtio infrastructure (esp. uapi in patch #2) from virtio >>> folks. >>> >>> I'm planning to send a proper v1 (!RFC) once I have all necessary MM >>> acks. In the meanwhile, I will do more testing and minor reworks (e.g., >>> fix !CONFIG_NUMA compilation). >> >> >> Hi David, >> >> Thanks for your work! >> >> I am trying your https://github.com/davidhildenbrand/linux.git virtio-mem-v5 >> which works fine for me, but just a 'DMA error' happens when a vm start with >> less than 2GB memory, Do I missed sth? > > Please use the virtio-mem-v4 branch for now, v5 is still under > construction (and might be scrapped completely if v4 goes upstream as is). > > Looks like a DMA issue. Your're hotplugging 1GB, which should not really > eat too much memory. There was a similar issue reported by Hui in [1], > which boiled down to wrong usage of the swiotlb parameter. > > In such cases you should always try to reproduce with hotplug of a > sam-sized DIMM. E.g., hotplugging a 1GB DIMM should result in the same > issue. > > What does your .config specify for CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE? > > I'll try to reproduce with v4 briefly.I guess I know what's happening here. In case we only have DMA memory when booting, we don't reserve swiotlb buffers. Once we hotplug memory and online ZONE_NORMAL, we don't have any swiotlb DMA bounce buffers to map such PFNs (total 0 (slots), used 0 (slots)). Can you try with "swiotlb=force" on the kernel cmdline? -- Thanks, David / dhildenb
? 2020/6/5 ??5:08, David Hildenbrand ??:> Please use the virtio-mem-v4 branch for now, v5 is still under > construction (and might be scrapped completely if v4 goes upstream as is). > > Looks like a DMA issue. Your're hotplugging 1GB, which should not really > eat too much memory. There was a similar issue reported by Hui in [1], > which boiled down to wrong usage of the swiotlb parameter.I have no swiotbl=noforce set, and sometime no swiotlb error reported, like (qemu) [ 41.591308] e1000 0000:00:03.0: dma_direct_map_page: overflow 0x000000011fd470da+54 of device mask ffffffff [ 41.592431] e1000 0000:00:03.0: TX DMA map failed [ 41.593031] e1000 0000:00:03.0: dma_direct_map_page: overflow 0x000000011fd474da+54 of device mask ffffff ... [ 63.049464] ata_piix 0000:00:01.1: dma_direct_map_sg: overflow 0x0000000107db2000+4096 of device mask ffffffff [ 63.068297] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0 [ 63.069057] ata1.00: failed command: READ DMA [ 63.069580] ata1.00: cmd c8/00:20:40:bd:d2/00:00:00:00:00/e0 tag 0 dma 16384 in [ 63.069580] res 50/00:00:3f:30:80/00:00:00:00:00/a0 Emask 0x40 (internal error)> > In such cases you should always try to reproduce with hotplug of a > sam-sized DIMM. E.g., hotplugging a 1GB DIMM should result in the same > issue. > > What does your .config specify for CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE?Yes, it's set. I had tried the v2/v4 version, which has the same issue. Is this related with virtio-mem start address too low? Thanks a lot!> > I'll try to reproduce with v4 briefly. > > [1] > https://lkml.kernel.org/r/9708F43A-9BD2-4377-8EE8-7FB1D95C6F69 at linux.alibaba.com
Apparently Analagous Threads
- [PATCH RFC v4 00/13] virtio-mem: paravirtualized memory
- [PATCH RFC v4 00/13] virtio-mem: paravirtualized memory
- [PATCH RFCv2 0/4] virtio-mem: paravirtualized memory
- [virtio-dev] [PATCH v3 00/15] virtio-mem: paravirtualized memory
- [PATCH v1 00/11] virtio-mem: paravirtualized memory