[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 72/73] cpu: add async_run_on_cpu_no_bql
From: |
Emilio G. Cota |
Subject: |
Re: [Qemu-devel] [PATCH v6 72/73] cpu: add async_run_on_cpu_no_bql |
Date: |
Sun, 3 Mar 2019 15:47:05 -0500 |
User-agent: |
Mutt/1.9.4 (2018-02-28) |
On Fri, Feb 08, 2019 at 14:58:40 +0000, Alex Bennée wrote:
>
> Emilio G. Cota <address@hidden> writes:
>
> > Some async jobs do not need the BQL.
> >
> > Reviewed-by: Richard Henderson <address@hidden>
> > Signed-off-by: Emilio G. Cota <address@hidden>
(snip)
> So we now have a locking/scheduling hierarchy that goes:
>
> - run_on_cpu - synchronously wait until target cpu has done the thing
> - async_run_on_cpu - schedule work on cpu at some point (soon) resources
> protected by BQL
> - async_run_on_cpu_no_bql - as above but only protected by cpu_lock
This one doesn't hold any locks when calling the passed function,
though. The CPU lock is just to serialise the queueing/dequeueing.
> - async_safe_run_on_cpu - as above but locking (probably) not required as
> everything else asleep
>
> So the BQL is only really needed to manipulate data that is shared
> across multiple vCPUs like device emulation or other state shared across
> multiple vCPUS. For all "just do it over there" cases we should be able
> to stick to cpu locks.
>
> It would be nice if we could expand the documentation in
> multi-thread-tcg.txt to cover this in long form for people trying to
> work out the best thing to use.
I think the documentation in the functions is probably enough -- they
point to each other, so figuring out what to use should be pretty easy.
Besides, these functions aren't MTTCG-only, they're QEMU-wide, so
perhaps their documentation should go in a different file?
Since this can be done later, I'll post a v7 with the other
changes you suggested.
> Reviewed-by: Alex Bennée <address@hidden>
Thanks!
Emilio
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH v6 72/73] cpu: add async_run_on_cpu_no_bql,
Emilio G. Cota <=