Re: [PATCH 03/21] Remove use of signalfd in block-raw-posix.c

Avi Kivity
2009-04-30T13:05:12Z

Anthony Liguori wrote:
> Avi Kivity wrote:
>> Anthony Liguori wrote:
>>> We don't use signalfd in upstream QEMU. Instead, we always emulate it.
>>>
>>
>> With an extra thread -> so an extra context switch.
>
> We don't use an extra thread. We just install a signal handler that
> writes to a pipe. At best, the added overhead is that we get EINTRs
> more often but this is something we already handle.

Oh okay. But signal delivery is slow; for example the FPU needs to be
reset.

> I'm not sure signalfd really buys us much. To emulate it requires
> writing a bunch more data to the pipe. When writing more than 1 byte,
> we have to worry about whether there's a partial write because the
> pipe buffers full). We also have to make sure to read from the fd in
> properly sized chunks.

Then we can use one byte writes (and reads) when signalfd is not
available. 128 byte pipe read/writes should always be atomic on Linux
though, likely on other OSes too.

--
error compiling committee.c: too many arguments to function