qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] cpus: Fix CPU unplug for MTTCG
@ 2017-04-13  7:51 Bharata B Rao
  2017-04-18  2:15 ` David Gibson
  0 siblings, 1 reply; 2+ messages in thread
From: Bharata B Rao @ 2017-04-13  7:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc, david, pbonzini, nikunj, alex.bennee, Bharata B Rao

Ensure that the unplugged CPU thread is destroyed and the waiting
thread is notified about it. This is needed for CPU unplug to work
correctly in MTTCG mode.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
---
 cpus.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/cpus.c b/cpus.c
index 740b8dc..79f780b 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1483,6 +1483,12 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
                 /* Ignore everything else? */
                 break;
             }
+        } else if (cpu->unplug) {
+            qemu_tcg_destroy_vcpu(cpu);
+            cpu->created = false;
+            qemu_cond_signal(&qemu_cpu_cond);
+            qemu_mutex_unlock_iothread();
+            return NULL;
         }
 
         atomic_mb_set(&cpu->exit_request, 0);
-- 
2.7.4

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

* Re: [Qemu-devel] [PATCH] cpus: Fix CPU unplug for MTTCG
  2017-04-13  7:51 [Qemu-devel] [PATCH] cpus: Fix CPU unplug for MTTCG Bharata B Rao
@ 2017-04-18  2:15 ` David Gibson
  0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2017-04-18  2:15 UTC (permalink / raw)
  To: Bharata B Rao; +Cc: qemu-devel, qemu-ppc, pbonzini, nikunj, alex.bennee

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

On Thu, Apr 13, 2017 at 01:21:46PM +0530, Bharata B Rao wrote:
> Ensure that the unplugged CPU thread is destroyed and the waiting
> thread is notified about it. This is needed for CPU unplug to work
> correctly in MTTCG mode.
> 
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>

Applied to ppc-for-2.10, thanks.

> ---
>  cpus.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/cpus.c b/cpus.c
> index 740b8dc..79f780b 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -1483,6 +1483,12 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
>                  /* Ignore everything else? */
>                  break;
>              }
> +        } else if (cpu->unplug) {
> +            qemu_tcg_destroy_vcpu(cpu);
> +            cpu->created = false;
> +            qemu_cond_signal(&qemu_cpu_cond);
> +            qemu_mutex_unlock_iothread();
> +            return NULL;
>          }
>  
>          atomic_mb_set(&cpu->exit_request, 0);

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2017-04-18  3:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-13  7:51 [Qemu-devel] [PATCH] cpus: Fix CPU unplug for MTTCG Bharata B Rao
2017-04-18  2:15 ` David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).