[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Using aio_poll for timer carrier threads
From: |
Jan Kiszka |
Subject: |
Re: [Qemu-devel] Using aio_poll for timer carrier threads |
Date: |
Wed, 14 Aug 2013 14:32:09 +0200 |
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 2013-08-13 16:13, Jan Kiszka wrote:
> On 2013-08-13 15:45, Stefan Hajnoczi wrote:
>> This should make timers usable in another thread for clock device
>> emulation if only your iothread uses the AioContext and its timers
>> (besides the thread-safe mod/del interfaces).
>
> As argued in the other thread, I don't think we need (and want) locking
> in the timer subsystem, rather push this to its users. But I'll look
> again at your patches, if they are also usable.
I've checked and applied your two patches adding the active_timers lock.
This model apparently works as well for the RTC use case. And it avoids
having to patch aio_poll, the RTC device lock is now taken inside the
timer handlers.
I still need to check more corner cases as timer dequeuing can now race
with the handler execution, ie. a dequeued timer can still see one more
handler run after timer_del returned. That's a property one can easily
take into account when writing device models, but it has to be kept in
mind that it's different from current behavior.
Updated queue is at git://git.kiszka.org/qemu.git queues/rt.new3 again.
Jan
--
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux
Re: [Qemu-devel] Using aio_poll for timer carrier threads, Paolo Bonzini, 2013/08/13