SIGBUS on wl_shm clients (Re: Newest git version of Wayland is even worse)

Bill Spitzak spitzak at gmail.com
Mon Dec 10 09:28:34 PST 2012


Changing XDG_RUNTIME_DIR to /run/shm (which is tmpfs) made a pretty 
significant improvement in wayland performance for me. I can run dozens 
of programs and they still drag around acceptably. This is with Gallium 
software egl and x11_compositor, which I was blaming for the slowness 
before. I think the behavior I am getting now, while not perfect, is 
certainly acceptable for actual users of Wayland!

It looks trivial to change os_create_anonymous_file to use shm_open.

Man page for shm_open says "The POSIX shared memory object 
implementation on Linux 2.4 makes use of a dedicated file system, which 
is normally mounted under /dev/shm." with no indication of how it finds 
it. Perhaps this locations is simply hard-coded into the system?

On 12/10/2012 12:08 AM, Pekka Paalanen wrote:

> The requirements for shm buffers are basically:
> - have an fd associated, so secure buffer passing works
> - is not backed by a disk or such, must be just memory (swapping is ok)
> - is automatically released, when all fds are closed and mmaps gone,
>    e.g. due to process crash
> - accessible only to the user who created it, on the fs level
>
> I know /dev/zero does not work for buffer passing, and /dev/null does
> not work at all.
>
> There is POSIX shared memory (shm_overview(7)), though, maybe we could
> use it, and fall back to XDG_RUNTIME_DIR. Does anyone remember a reason
> for not using POSIX shm?
>
> Android didn't have POSIX shm, but they can fall back to
> XDG_RUNTIME_DIR. IIRC Raspberry Pi did not have a separate tmpfs
> for /dev/shm, it was all just /dev.
>
> Do not confuse with System V SHM.
>
>
> Thanks,
> pq
>



More information about the wayland-devel mailing list