[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v2 09/11] tcg: add kick timer for single-threaded
From: |
Alex Bennée |
Subject: |
Re: [Qemu-devel] [RFC v2 09/11] tcg: add kick timer for single-threaded vCPU emulation |
Date: |
Thu, 02 Jun 2016 17:00:22 +0100 |
User-agent: |
mu4e 0.9.17; emacs 25.0.94.4 |
Sergey Fedorov <address@hidden> writes:
> On 05/04/16 18:32, Alex Bennée wrote:
>> +static void kick_tcg_thread(void *opaque)
>> +{
>> + QEMUTimer *self = *(QEMUTimer **) opaque;
>> + timer_mod(self,
>> + qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
>> + NANOSECONDS_PER_SECOND / 10);
>> + qemu_cpu_kick_no_halt();
>> +}
>>
>
> It would be nice to have some definition (e.g. macro) of TCG thread kick
> period.
Will do.
>
> (snip)
>
>> @@ -1179,6 +1198,14 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
>> }
>> }
>>
>> + /* Set to kick if we have to do more than one vCPU */
>> + if (CPU_NEXT(first_cpu)) {
>> + kick_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, kick_tcg_thread,
>> &kick_timer);
>> + timer_mod(kick_timer,
>> + qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
>> + NANOSECONDS_PER_SECOND / 10);
>> + }
>> +
>
> I think cpu_ticks_init() could be more natural place to put this
> initialization in.
It would be but I need somewhere to keep kick_timer and doing it inside
the thread function keeps it nice and local.
>
> Kind regards,
> Sergey
--
Alex Bennée
- Re: [Qemu-devel] [RFC v2 09/11] tcg: add kick timer for single-threaded vCPU emulation,
Alex Bennée <=