@valpackett@social.treehouse.systems
2026-08-24 08:31 UTC
Woooo hecking yes \o/ the True 100% Zero-Copy Fast Path for Wayland SHM sharing over virtio-gpu works!! This has been kind of an open side-quest for me for like a year. Finally was motivated to actually-just-do-it by the fact that on Xen it's actually easier to use "guest" memory rather than "host" (wellllll, I guess "in a clean upstreamable way" only, actually) and we'll need guest support for that and upstreaming said support will need a KVM-based demo so here it works on libkrun.
It does involve one slightly cursed(?) step which is that the Wayland proxy in the guest does just grow the provided pool memfds to align to page size but it seems like clients don't mind.
And wow I usually don't really think about just how fragmented memory buffers get, but udmabuf_create_list is currently limited to 1024 entries by default (configurable w/ udmabuf.list_limit=..) and these buffers are frequently spread across many thousands of discontinuous GPA ranges. The ridiculously massive buffer allocated by the foot terminal goes up to 40K ranges! i.e. just the command to make a shareable kernel object out of those guest memory ranges takes up close to a megabyte :D
Replies (0)
No replies.