[Top][All Lists]

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

Re: [Qemu-devel] [RFC PATCH v8 08/21] cpu: replay instructions sequence

From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC PATCH v8 08/21] cpu: replay instructions sequence
Date: Tue, 17 Feb 2015 11:58:41 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 17/02/2015 09:43, Pavel Dovgaluk wrote:
>> >      int64_t deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL);
>> >      if (deadline == 0) {
>> >          qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
>> >      }
>> > 
>> > instead of qemu_notify_event(), and remove these lines from
>> > qemu_tcg_cpu_thread_fn.
> I tried this one. But there is one problem.
> Expiring of the virtual timers is not the only reason of icount expiration in 
> replay mode.
> It may be caused by host timers deadline or poll timeout in record mode. In 
> this case 
> qemu_clock_notify(QEMU_CLOCK_VIRTUAL) will not be called in replay mode and 
> we'll waste time for iothread sleeping.

Sure, but unconditional qemu_notify_event() is also wrong.  So, to sum up:

- it's okay to move code from qemu_tcg_cpu_thread_fn to cpu-exec.c

- it's okay to add more qemu_clock_notify calls than just
qemu_clock_notify(QEMU_CLOCK_VIRTUAL), each with its own condition

- it's better if all these, after being moved to cpu-exec.c, are also
extracted in a separate function

- it's not okay to do an unconditional qemu_notify_event() in
cpu-exec.c, even if it's under "if (replay_mode != NONE)".

Thanks for your understanding! :)


reply via email to

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