All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] cpus: remove useless cond signal
@ 2018-05-14 11:55 linzhecheng
  2018-05-14 12:19 ` Peter Maydell
  0 siblings, 1 reply; 2+ messages in thread
From: linzhecheng @ 2018-05-14 11:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, crosthwaite.peter, rth, wangxinxin.wang, linzhecheng

commit dbadee4 removed qemu_cond_wait in cpu_remove_sync, so it is
useless to keep qemu_cond_signal here.

Signed-off-by: linzhecheng <linzhecheng@huawei.com>

diff --git a/cpus.c b/cpus.c
index 5bcd3ecf38..c7262484f3 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1222,7 +1222,6 @@ static void *qemu_kvm_cpu_thread_fn(void *arg)
 
     qemu_kvm_destroy_vcpu(cpu);
     cpu->created = false;
-    qemu_cond_signal(&qemu_cpu_cond);
     qemu_mutex_unlock_iothread();
     rcu_unregister_thread();
     return NULL;
-- 
2.12.2.windows.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] cpus: remove useless cond signal
  2018-05-14 11:55 [Qemu-devel] [PATCH] cpus: remove useless cond signal linzhecheng
@ 2018-05-14 12:19 ` Peter Maydell
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2018-05-14 12:19 UTC (permalink / raw)
  To: linzhecheng
  Cc: QEMU Developers, Paolo Bonzini, wangxinxin.wang,
	Richard Henderson, Peter Crosthwaite

On 14 May 2018 at 12:55, linzhecheng <linzhecheng@huawei.com> wrote:
> commit dbadee4 removed qemu_cond_wait in cpu_remove_sync, so it is
> useless to keep qemu_cond_signal here.
>
> Signed-off-by: linzhecheng <linzhecheng@huawei.com>
>
> diff --git a/cpus.c b/cpus.c
> index 5bcd3ecf38..c7262484f3 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -1222,7 +1222,6 @@ static void *qemu_kvm_cpu_thread_fn(void *arg)
>
>      qemu_kvm_destroy_vcpu(cpu);
>      cpu->created = false;
> -    qemu_cond_signal(&qemu_cpu_cond);
>      qemu_mutex_unlock_iothread();
>      rcu_unregister_thread();
>      return NULL;
> --
> 2.12.2.windows.2

At the moment we seem to have an invariant "everywhere we
set cpu->created = false we also signal the qemu_cpu_cond".
If signalling the condition is no longer necessary in this
function, is it also no longer necessary in all the other
places where we do it after setting created = false ?

thanks
-- PMM

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-14 12:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-14 11:55 [Qemu-devel] [PATCH] cpus: remove useless cond signal linzhecheng
2018-05-14 12:19 ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.