[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] cpus: fix TCG kick timer leak
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] cpus: fix TCG kick timer leak |
Date: |
Fri, 28 Sep 2018 12:37:16 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 |
On 27/09/2018 19:17, Alex Bennée wrote:
> This is an alternative fix to Marc's original patch as per Paolo's suggestion.
>
> Reported-by: Marc-André Lureau <address@hidden>
> Suggested-by: Paolo Bonzini <address@hidden>
> Signed-off-by: Alex Bennée <address@hidden>
> ---
> cpus.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/cpus.c b/cpus.c
> index 719788320f..d7d69a101e 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -964,6 +964,8 @@ static void start_tcg_kick_timer(void)
> if (!tcg_kick_vcpu_timer && CPU_NEXT(first_cpu)) {
> tcg_kick_vcpu_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,
> kick_tcg_thread, NULL);
> + }
> + if (tcg_kick_vcpu_timer && !timer_pending(tcg_kick_vcpu_timer)) {
> timer_mod(tcg_kick_vcpu_timer, qemu_tcg_next_kick());
> }
> }
> @@ -971,9 +973,8 @@ static void start_tcg_kick_timer(void)
> static void stop_tcg_kick_timer(void)
> {
> assert(!mttcg_enabled);
> - if (tcg_kick_vcpu_timer) {
> + if (tcg_kick_vcpu_timer && timer_pending(tcg_kick_vcpu_timer)) {
> timer_del(tcg_kick_vcpu_timer);
> - tcg_kick_vcpu_timer = NULL;
> }
> }
>
>
Queued, thanks.
Paolo