qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [5578] Increase default IO timeout from 10ms to 5s


From: Jan Kiszka
Subject: [Qemu-devel] Re: [5578] Increase default IO timeout from 10ms to 5s
Date: Mon, 03 Nov 2008 23:03:05 +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

Anthony Liguori wrote:
> Jan Kiszka wrote:
>> Jan Kiszka wrote:
>>  
>> There is a race between the alarm_timer firing SIGALRM and
>> main_loop_wait reaching the safe harbor of select (with that infamous 5
>> second timeout). If the signal comes when already blocked in select, it
>> will properly resume the latter immediately. But if the timer fired
>> BEFORE that point, host_alarm_handler will only set a flag that the host
>> timer has fired, the actual rearming will be done AFTER return from
>> select. Ooops....
>>   
> 
> Ah, so before this was causing the timer to potentially come 10ms later
> than it should have.  I was hoping that this change would shake out this
> stuff :-)
> 
>> So, select should actually include the host timer as event. timerfd?
>> Unfortunately a recent Linux-only feature :-/. I don't think we can
>> rearm the timer from within the signal handler, at least not without
>> running all the pending qemu timers. And that is surely not a signal
>> handler job (qemu timer handler aren't thread-safe in general).
>>
>> Anyone any ideas? /me is thinking a bit more about it as well.
>>   
> 
> host_alarm_handler should write to a file descriptor instead of setting
> a flag.  That file descriptor should then be select()'d on (just like we
> do for SIGUSR2 in block-raw-posix.c).

A pipe, that slowly came to my mind as well. OK, will play with it.

Jan

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]