qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: richard.henderson@linaro.org
Subject: Re: [PATCH] replay: don't wait in run_on_cpu
Date: Mon, 29 Mar 2021 13:55:29 +0300	[thread overview]
Message-ID: <2f94f9b5-0a90-dbc1-e35e-d6c43580c127@ispras.ru> (raw)
In-Reply-To: <e18262ca-c41b-2257-323a-ff22ba462ed5@redhat.com>

On 29.03.2021 12:42, Paolo Bonzini wrote:
> On 29/03/21 10:05, Pavel Dovgalyuk wrote:
>> @@ -136,7 +137,13 @@ void do_run_on_cpu(CPUState *cpu, run_on_cpu_func 
>> func, run_on_cpu_data data,
>>   {
>>       struct qemu_work_item wi;
>> -    if (qemu_cpu_is_self(cpu)) {
>> +    if (qemu_cpu_is_self(cpu)
>> +        /*
>> +         * vCPU thread is waiting when replay mutex is locked
>> +         * and the task is not exclusive, the function may be called
>> +         * without other synchronization.
>> +         */
>> +        || (replay_mode != REPLAY_MODE_NONE && replay_mutex_locked())) {
>>           func(cpu, data);
>>           return;
>>       }
> 
> Is the "or" saying that the execution is using the lockstep mode?  If 
> so, can you put it in a separate function so that it's more 
> self-explanatory and check if it should be used elsewhere?

It was replay (is that lockstep that you mentioned?).
I check that the mutex is already locked, which means, that vCPU
does nothing at this moment.

Pavel Dovgalyuk


  reply	other threads:[~2021-03-29 10:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29  8:05 [PATCH] replay: don't wait in run_on_cpu Pavel Dovgalyuk
2021-03-29  9:42 ` Paolo Bonzini
2021-03-29 10:55   ` Pavel Dovgalyuk [this message]
2021-03-29 12:11     ` Paolo Bonzini
  -- strict thread matches above, loose matches on Subject: below --
2021-03-11  7:14 Pavel Dovgalyuk
2021-03-15  5:59 ` Pavel Dovgalyuk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2f94f9b5-0a90-dbc1-e35e-d6c43580c127@ispras.ru \
    --to=pavel.dovgalyuk@ispras.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).