[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 5/8] timers: prepare the code for future races i
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 5/8] timers: prepare the code for future races in calling qemu_clock_warp |
Date: |
Tue, 08 Oct 2013 18:56:43 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9 |
Il 08/10/2013 18:54, Alex Bligh ha scritto:
>> > -
>> > - /* Maintain prior (possibly buggy) behaviour where if no deadline
>> > - * was set (as there is no QEMU_CLOCK_VIRTUAL timer) or it is more
>> > than
>> > - * INT32_MAX nanoseconds ahead, we still use INT32_MAX
>> > - * nanoseconds.
>> > - */
>> > - if ((deadline < 0) || (deadline > INT32_MAX)) {
>> > - deadline = INT32_MAX;
>> > + if (deadline < 0) {
>> > + return;
>> > }
>
> Arguably the patch could document why removing the check for deadline >
> INT32_MAX
> (the bug for bug compatibility) is safe, as I couldn't entirely convince
> myself it
> was, mostly because I couldn't see why it was doing it in the first place.
I couldn't convince myself that it is _not_ safe :) and it made the code
more complicated. As soon as a deadline appears, qemu_clock_warp() will
be called again and update the icount_warp_timer.
Ok to move that to a separate patch?
Paolo
[Qemu-devel] [PATCH 6/8] timers: introduce cpu_get_clock_locked, Paolo Bonzini, 2013/10/08
[Qemu-devel] [PATCH 7/8] timers: document (future) locking rules for icount, Paolo Bonzini, 2013/10/08
[Qemu-devel] [PATCH 8/8] timers: make icount thread-safe, Paolo Bonzini, 2013/10/08
Re: [Qemu-devel] [PATCH 0/8] Make icount thread-safe, Andreas Färber, 2013/10/08