[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 09/17] aio: prepare for introducing GSource-base
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 09/17] aio: prepare for introducing GSource-based dispatch |
Date: |
Wed, 26 Sep 2012 08:36:16 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 |
Il 26/09/2012 00:01, Anthony Liguori ha scritto:
>> > + node->pfd.events = G_IO_ERR;
>> > + node->pfd.events |= (io_read ? G_IO_IN | G_IO_HUP : 0);
>> > + node->pfd.events |= (io_write ? G_IO_OUT : 0);
>> > }
> Should we even set G_IO_ERR? I think that corresponds to exceptfd
No, that would be G_IO_PRI.
> in select() but we've never set that historically. I know glib recommends
> it but I don't think it's applicable to how we use it.
>
> Moreover, the way you do dispatch, if G_IO_ERR did occur, we'd dispatch
> both the read and write handlers which definitely isn't right.
I'm not sure what gives POLLERR. Probably a connect() that fails, and
in that case dispatching on the write handler would be okay. But I was
not sure and calling both is safe: handlers have to be ready for
spurious wakeups anyway, it happens if qemu_aio_wait dispatches from a
VCPU thread before the main loop gets hold of the big lock.
> I think it's easiest just to drop it.
That's indeed the case, since the current code never sets either
G_IO_HUP or G_IO_ERR.
Paolo
- Re: [Qemu-devel] [PATCH 06/17] aio: introduce AioContext, move bottom halves there, (continued)
- [Qemu-devel] [PATCH 05/17] aio: provide platform-independent API, Paolo Bonzini, 2012/09/25
- [Qemu-devel] [PATCH 07/17] aio: add I/O handlers to the AioContext interface, Paolo Bonzini, 2012/09/25
- [Qemu-devel] [PATCH 08/17] aio: add non-blocking variant of aio_wait, Paolo Bonzini, 2012/09/25
- [Qemu-devel] [PATCH 10/17] aio: add Win32 implementation, Paolo Bonzini, 2012/09/25
- [Qemu-devel] [PATCH 09/17] aio: prepare for introducing GSource-based dispatch, Paolo Bonzini, 2012/09/25
- [Qemu-devel] [PATCH 12/17] aio: add aio_notify, Paolo Bonzini, 2012/09/25
- [Qemu-devel] [PATCH 13/17] aio: call aio_notify after setting I/O handlers, Paolo Bonzini, 2012/09/25
- [Qemu-devel] [PATCH 14/17] main-loop: use GSource to poll AIO file descriptors, Paolo Bonzini, 2012/09/25
- [Qemu-devel] [PATCH 16/17] aio: clean up now-unused functions, Paolo Bonzini, 2012/09/25