qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC v4 24/71] s390x: convert to cpu_halted


From: Emilio G. Cota
Subject: Re: [Qemu-devel] [RFC v4 24/71] s390x: convert to cpu_halted
Date: Wed, 31 Oct 2018 12:38:46 -0400
User-agent: Mutt/1.9.4 (2018-02-28)

On Wed, Oct 31, 2018 at 16:13:05 +0000, Alex Bennée wrote:
> > @@ -353,10 +355,12 @@ void s390_cpu_unhalt(S390CPU *cpu)
> >      CPUState *cs = CPU(cpu);
> >      trace_cpu_unhalt(cs->cpu_index);
> >
> > -    if (cs->halted) {
> > -        cs->halted = 0;
> > +    cpu_mutex_lock(cs);
> > +    if (cpu_halted(cs)) {
> > +        cpu_halted_set(cs, 0);
> >          cs->exception_index = -1;
> >      }
> > +    cpu_mutex_unlock(cs);
> 
> I think this locking is superfluous as you already added locking when
> you introduced the helper.

It gives a small perf gain, since it avoids locking & unlocking twice
in a row (cpu_halted and cpu_halted_set both take the lock if needed).

> Otherwise:
> 
> Reviewed-by: Alex Bennée <address@hidden>

Thanks!

                Emilio



reply via email to

[Prev in Thread] Current Thread [Next in Thread]