[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 11/13] cpu-exec-common: Introduce async_safe_
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v5 11/13] cpu-exec-common: Introduce async_safe_run_on_cpu() |
Date: |
Mon, 29 Aug 2016 19:26:36 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
> The problem with CPUs coming up late is indeed present in this patch,
> I'll review your patch on the flight. :)
>
> synchronize_rcu() is actually relatively cheap with URCU, so I guess
> that's fine. An alternative to that could be a pthread_barrier_t, but
> it can be added later.
>
> Another way to fix the issue with a variable number of waiters could be
> to wrap safe work with rcu_read_lock and rcu_read_unlock, and put a
> synchronize_rcu() at the beginning of the CPU thread function. But it
> can be done later too.
>
> Your patch from a year ago, right now, seems to be the best to me. I'd
> like to make it use regular work items instead of the special
> cpu->tcg_work_func, but that's pretty much it.
Ok, I think I have something. It only uses condition variables when
there is a safe work in flight, to enter and leave the function at the
right time. It also makes linux-user's start_exclusive/end_exclusive
use the same synchronization logic. I'll test it and post; most
preliminary patches are straight from this series.
Paolo
- Re: [Qemu-devel] [PATCH v5 13/13] cpu-exec: replace cpu->queued_work with GArray, (continued)