virtio-gpu vq code isn't thread safe

Dave Airlie airlied at
Mon Jun 15 21:55:23 PDT 2015

Hey Gerd,

This probably doesn't matter yet, but they virtgpu_vq buffer
allocation code you added isn't threadsafe.

I'm not sure what was wrong with the original code I wrote, you never
contacted me with reasons for rewriting it, but the Linux kmalloc
isn't that slow, but if we want some form of cached allocator you
probably should just use kmem_cache_create instead of what you have

The second any code hits that from two threads its going to explode as
the free buffers list isn't protected with a lock of any kind, I know
userspace might not be able to hit this at present, but this is a big
problem when we add the 3D code.


More information about the dri-devel mailing list