Date: Fri, 18 May 2018 23:54:50 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 228335] [patch] virtio indirect descriptors should use contiguous memory Message-ID: <bug-228335-227-jidu2PGE1H@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-228335-227@https.bugs.freebsd.org/bugzilla/> References: <bug-228335-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=228335 --- Comment #1 from Bryan Venteicher <bryanv@FreeBSD.org> --- See this comment in virtio.h: /* * Each virtqueue indirect descriptor list must be physically contiguous. * To allow us to malloc(9) each list individually, limit the number * supported to what will fit in one page. With 4KB pages, this is a limit * of 256 descriptors. If there is ever a need for more, we can switch to * contigmalloc(9) for the larger allocations, similar to what * bus_dmamem_alloc(9) does. * * Note the sizeof(struct vring_desc) is 16 bytes. */ #define VIRTIO_MAX_INDIRECT ((int) (PAGE_SIZE / 16)) This code is quite old but my recollection is that the minimum allocation returned by contigmalloc() is (was?) a page which ends up wasting a lot of memory. What is the "different memory allocator"? If you're indifferent to VirtIO then disabling indrect descriptors is an option. However, I believe there are a handful of other places in VirtIO where the malloc allocation is capped at one page. That being said, I don't like depending on the behavior of malloc behavior here. I'm working on VirtIO V1 support, and after that, was going to switch VirtIO to bus_dma(9) for later IOMMU/"physical" virtio devices support. -- You are receiving this mail because: You are the assignee for the bug.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-228335-227-jidu2PGE1H>
