Re: [Qemu-devel] [PATCH] cpus: run work items for all vCPUs if single-threaded

2018-11-15 Thread Emilio G. Cota
On Fri, Nov 16, 2018 at 00:15:53 +0100, Paolo Bonzini wrote: > On 14/11/2018 20:42, Emilio G. Cota wrote: > > On Wed, Nov 14, 2018 at 12:44:00 +0100, Paolo Bonzini wrote: > >> This avoids the following deadlock: > >> > >> 1) a thread calls run_on_cpu for CPU 2 from a timer, and > >> single_tcg_hal

Re: [Qemu-devel] [PATCH] cpus: run work items for all vCPUs if single-threaded

2018-11-15 Thread Paolo Bonzini
On 14/11/2018 20:42, Emilio G. Cota wrote: > On Wed, Nov 14, 2018 at 12:44:00 +0100, Paolo Bonzini wrote: >> This avoids the following deadlock: >> >> 1) a thread calls run_on_cpu for CPU 2 from a timer, and single_tcg_halt_cond >> is signaled >> >> 2) CPU 1 is running and exits. It finds no work

Re: [Qemu-devel] [PATCH] cpus: run work items for all vCPUs if single-threaded

2018-11-14 Thread Emilio G. Cota
On Wed, Nov 14, 2018 at 12:44:00 +0100, Paolo Bonzini wrote: > This avoids the following deadlock: > > 1) a thread calls run_on_cpu for CPU 2 from a timer, and single_tcg_halt_cond > is signaled > > 2) CPU 1 is running and exits. It finds no work item and enters CPU 2 > > 3) because the I/O thr

[Qemu-devel] [PATCH] cpus: run work items for all vCPUs if single-threaded

2018-11-14 Thread Paolo Bonzini
This avoids the following deadlock: 1) a thread calls run_on_cpu for CPU 2 from a timer, and single_tcg_halt_cond is signaled 2) CPU 1 is running and exits. It finds no work item and enters CPU 2 3) because the I/O thread is stuck in run_on_cpu, the round-robin kick timer never triggers, and CP