[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH] fix select(2) race between main_loop_wait a
From: |
Jan Kiszka |
Subject: |
Re: [Qemu-devel] [RFC PATCH] fix select(2) race between main_loop_wait and qemu_aio_wait |
Date: |
Mon, 05 Mar 2012 18:55:56 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
On 2012-03-05 18:39, Avi Kivity wrote:
> On 03/05/2012 04:30 PM, Jan Kiszka wrote:
>> On 2012-03-05 15:24, Avi Kivity wrote:
>>>> Long-term, I'd like to cut out certain file descriptors from the main
>>>> loop and process them completely in separate threads (for separate
>>>> locking, prioritization etc.). Dunno how NBD works, but maybe it should
>>>> be reworked like this already.
>>>
>>> Ideally qemu_set_fd_handler2() should be made thread local, and each
>>> device thread would run a copy of the main loop, just working on
>>> different data.
>>
>> qemu_set_fd_handler2 may not only be called over an iothread. Rather, we
>> need an object and associated lock that is related to the io-path (i.e.
>> frontend device + backend driver). That object has to be passed to
>> services like qemu_set_fd_handler2.
>
> Not sure I like implicit lock-taking. In particular, how does it
> interact with unregistering an fd_handler?
I wasn't suggesting implicit lock taking, just decoupling from our
infamous global lock. My point is that thread-local won't help here.
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
- [Qemu-devel] [RFC PATCH] fix select(2) race between main_loop_wait and qemu_aio_wait, Paolo Bonzini, 2012/03/05
- Re: [Qemu-devel] [RFC PATCH] fix select(2) race between main_loop_wait and qemu_aio_wait, Jan Kiszka, 2012/03/05
- Re: [Qemu-devel] [RFC PATCH] fix select(2) race between main_loop_wait and qemu_aio_wait, Paolo Bonzini, 2012/03/05
- Re: [Qemu-devel] [RFC PATCH] fix select(2) race between main_loop_wait and qemu_aio_wait, Avi Kivity, 2012/03/05
- Re: [Qemu-devel] [RFC PATCH] fix select(2) race between main_loop_wait and qemu_aio_wait, Paolo Bonzini, 2012/03/05
- Re: [Qemu-devel] [RFC PATCH] fix select(2) race between main_loop_wait and qemu_aio_wait, Avi Kivity, 2012/03/05
- Re: [Qemu-devel] [RFC PATCH] fix select(2) race between main_loop_wait and qemu_aio_wait, Paolo Bonzini, 2012/03/06