qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] replay: don't wait in run_on_cpu


From: Paolo Bonzini
Subject: Re: [PATCH] replay: don't wait in run_on_cpu
Date: Mon, 29 Mar 2021 11:42:02 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0

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?

Thanks,

Paolo




reply via email to

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