|
From: | Pavel Dovgalyuk |
Subject: | Re: [PATCH] replay: don't wait in run_on_cpu |
Date: | Mon, 29 Mar 2021 13:55:29 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |