qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] d6f4ade214a9f74dca9495b83a24ff9c113e4f9a
@ 2010-04-05 13:51 malc
  2010-04-06 20:16 ` [Qemu-devel] [PATCH] fix 100% cpu utilization when cpu is stopped (was Re: d6f4ade214a9f74dca9495b83a24ff9c113e4f9a) Paolo Bonzini
  0 siblings, 1 reply; 4+ messages in thread
From: malc @ 2010-04-05 13:51 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel

Hello,

d6f4ade214a9f74dca9495b83a24ff9c113e4f9a: disentangle tcg and deadline calculation
introduces following regression(s):

100% cpu utilization when QEMU is invoked like:
qemu -S -s ...

ditto when gdb takes control over the session via gdb-stub
(i.e. the breakpoint is hit or C-c is pressed inside gdb to
 interrupt the attached qemu instance)

-- 
mailto:av1474@comtv.ru

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

* [Qemu-devel] [PATCH] fix 100% cpu utilization when cpu is stopped (was Re: d6f4ade214a9f74dca9495b83a24ff9c113e4f9a)
  2010-04-05 13:51 [Qemu-devel] d6f4ade214a9f74dca9495b83a24ff9c113e4f9a malc
@ 2010-04-06 20:16 ` Paolo Bonzini
  2010-04-06 21:17   ` [Qemu-devel] " malc
  0 siblings, 1 reply; 4+ messages in thread
From: Paolo Bonzini @ 2010-04-06 20:16 UTC (permalink / raw)
  To: malc; +Cc: qemu-devel

On 04/05/2010 03:51 PM, malc wrote:
> Hello,
>
> d6f4ade214a9f74dca9495b83a24ff9c113e4f9a: disentangle tcg and deadline calculation
> introduces following regression(s):
>
> 100% cpu utilization when QEMU is invoked like:
> qemu -S -s ...
>
> ditto when gdb takes control over the session via gdb-stub
> (i.e. the breakpoint is hit or C-c is pressed inside gdb to
>   interrupt the attached qemu instance)

The bug is that env->stopped is not really as comprehensive as it seems 
to be (and cpu_has_work thinks); it is only valid with iothread 
basically, and even then it is cleared by reset and it is not set when 
starting qemu with -S.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

diff --git a/cpus.c b/cpus.c
index a2e0642..0debe77 100644
--- a/cpus.c
+++ b/cpus.c
@@ -100,9 +100,7 @@ static int cpu_can_run(CPUState *env)
  {
      if (env->stop)
          return 0;
-    if (env->stopped)
-        return 0;
-    if (!vm_running)
+    if (env->stopped || !vm_running)
          return 0;
      return 1;
  }
@@ -111,7 +109,7 @@ static int cpu_has_work(CPUState *env)
  {
      if (env->stop)
          return 1;
-    if (env->stopped)
+    if (env->stopped || !vm_running)
          return 0;
      if (!env->halted)
          return 1;

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

* [Qemu-devel] Re: [PATCH] fix 100% cpu utilization when cpu is stopped (was Re: d6f4ade214a9f74dca9495b83a24ff9c113e4f9a)
  2010-04-06 20:16 ` [Qemu-devel] [PATCH] fix 100% cpu utilization when cpu is stopped (was Re: d6f4ade214a9f74dca9495b83a24ff9c113e4f9a) Paolo Bonzini
@ 2010-04-06 21:17   ` malc
  2010-04-06 22:11     ` [Qemu-devel] [PATCH resend] fix 100% cpu utilization when cpu is stopped Paolo Bonzini
  0 siblings, 1 reply; 4+ messages in thread
From: malc @ 2010-04-06 21:17 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On Tue, 6 Apr 2010, Paolo Bonzini wrote:

> On 04/05/2010 03:51 PM, malc wrote:
> > Hello,
> > 
> > d6f4ade214a9f74dca9495b83a24ff9c113e4f9a: disentangle tcg and deadline
> > calculation
> > introduces following regression(s):
> > 
> > 100% cpu utilization when QEMU is invoked like:
> > qemu -S -s ...
> > 
> > ditto when gdb takes control over the session via gdb-stub
> > (i.e. the breakpoint is hit or C-c is pressed inside gdb to
> >   interrupt the attached qemu instance)
> 
> The bug is that env->stopped is not really as comprehensive as it seems to be
> (and cpu_has_work thinks); it is only valid with iothread basically, and even
> then it is cleared by reset and it is not set when starting qemu with -S.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> diff --git a/cpus.c b/cpus.c
> index a2e0642..0debe77 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -100,9 +100,7 @@ static int cpu_can_run(CPUState *env)
>  {
>      if (env->stop)
>          return 0;
> -    if (env->stopped)
> -        return 0;
> -    if (!vm_running)
> +    if (env->stopped || !vm_running)
>          return 0;
>      return 1;
>  }
> @@ -111,7 +109,7 @@ static int cpu_has_work(CPUState *env)
>  {
>      if (env->stop)
>          return 1;
> -    if (env->stopped)
> +    if (env->stopped || !vm_running)
>          return 0;
>      if (!env->halted)
>          return 1;
> 

This doesn't apply for whatever reason, i patched the thing by hand
and things seem to work, thanks, care to resend?

-- 
mailto:av1474@comtv.ru

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

* [Qemu-devel] [PATCH resend] fix 100% cpu utilization when cpu is stopped
  2010-04-06 21:17   ` [Qemu-devel] " malc
@ 2010-04-06 22:11     ` Paolo Bonzini
  0 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2010-04-06 22:11 UTC (permalink / raw)
  To: qemu-devel

> Hello,
>
> d6f4ade (disentangle tcg and deadline calculation, 2010-03-10)
> introduces following regression(s):
>
> 100% cpu utilization when QEMU is invoked like:
> qemu -S -s ...
>
> ditto when gdb takes control over the session via gdb-stub
> (i.e. the breakpoint is hit or C-c is pressed inside gdb to
>   interrupt the attached qemu instance)

The bug is that env->stopped is not really as comprehensive as it seems to
be (and cpu_has_work thinks); it is only valid with iothread basically,
and even then it is cleared by reset and it is not set when starting
qemu with -S.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: malc <av1474@comtv.ru>
---
 cpus.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/cpus.c b/cpus.c
index a2e0642..0debe77 100644
--- a/cpus.c
+++ b/cpus.c
@@ -100,9 +100,7 @@ static int cpu_can_run(CPUState *env)
 {
     if (env->stop)
         return 0;
-    if (env->stopped)
-        return 0;
-    if (!vm_running)
+    if (env->stopped || !vm_running)
         return 0;
     return 1;
 }
@@ -111,7 +109,7 @@ static int cpu_has_work(CPUState *env)
 {
     if (env->stop)
         return 1;
-    if (env->stopped)
+    if (env->stopped || !vm_running)
         return 0;
     if (!env->halted)
         return 1;
-- 
1.6.6.1

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

end of thread, other threads:[~2010-04-06 22:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-05 13:51 [Qemu-devel] d6f4ade214a9f74dca9495b83a24ff9c113e4f9a malc
2010-04-06 20:16 ` [Qemu-devel] [PATCH] fix 100% cpu utilization when cpu is stopped (was Re: d6f4ade214a9f74dca9495b83a24ff9c113e4f9a) Paolo Bonzini
2010-04-06 21:17   ` [Qemu-devel] " malc
2010-04-06 22:11     ` [Qemu-devel] [PATCH resend] fix 100% cpu utilization when cpu is stopped Paolo Bonzini

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).