From: Richard Henderson <rth@twiddle.net>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: mttcg@greensocs.com, cota@braap.org
Subject: Re: [Qemu-devel] [PATCH v2 0/9] tcg: signal-free qemu_cpu_kick
Date: Thu, 27 Aug 2015 21:21:14 -0700 [thread overview]
Message-ID: <55DFE1BA.9050306@twiddle.net> (raw)
In-Reply-To: <1440548265-4755-1-git-send-email-pbonzini@redhat.com>
On 08/25/2015 05:17 PM, Paolo Bonzini wrote:
> This version of the signal-free qemu_cpu_kick patches is, ehm, much
> better. Variable are accessed either with Java-style volatiles or
> protected by memory barriers, and the cleanups go further by removing
> qemu/tls.h and C volatiles.
>
> The logic is relatively simple. The I/O thread does (letters in
> parentheses indicates the synchronizes-with edges):
>
> run_on_cpu or similar
> ...
> seq_cst write 1 to exit_request (C)
> seq_cst read tcg_current_cpu to cpu (B)
> if not NULL
> write 1 to cpu->exit_request
> release barrier (A)
> write 1 to cpu->tcg_exit_req
>
> The CPU thread does either this:
>
> (in generated code) read cpu->tcg_exit_req
> acquire barrier (A)
> read cpu->exit_request
> exit from cpu_exec
> seq_cst write 0 to exit_request
> ...
> flush_queued_work or similar
>
> or this:
>
> seq_cst write to tcg_current_cpu (B)
> seq_cst read from exit_request (C)
> exit from cpu_exec
> seq_cst write 0 to exit_request
> ...
> flush_queued_work or similar
>
> The non-TLS tcg_current_cpu will go away with multi-threaded TCG.
>
> Paolo
>
> Paolo Bonzini (9):
> i8257: rewrite DMA_schedule to avoid hooking into the CPU loop
> i8257: remove cpu_request_exit irq
> tcg: introduce tcg_current_cpu
> remove qemu/tls.h
> tcg: assign cpu->current_tb in a simpler place
> tcg: synchronize cpu->exit_request and cpu->tcg_exit_req accesses
> tcg: synchronize exit_request and tcg_current_cpu accesses
> use qemu_cpu_kick instead of cpu_exit or qemu_cpu_kick_thread
> tcg: signal-free qemu_cpu_kick
Reviewed-by: Richard Henderson <rth@twiddle.net>
r~
prev parent reply other threads:[~2015-08-28 4:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-26 0:17 [Qemu-devel] [PATCH v2 0/9] tcg: signal-free qemu_cpu_kick Paolo Bonzini
2015-08-26 0:17 ` [Qemu-devel] [PATCH 1/9] i8257: rewrite DMA_schedule to avoid hooking into the CPU loop Paolo Bonzini
2015-08-26 0:17 ` [Qemu-devel] [PATCH 2/9] i8257: remove cpu_request_exit irq Paolo Bonzini
2015-08-26 0:17 ` [Qemu-devel] [PATCH 3/9] tcg: introduce tcg_current_cpu Paolo Bonzini
2015-08-26 0:17 ` [Qemu-devel] [PATCH 4/9] remove qemu/tls.h Paolo Bonzini
2015-08-26 0:17 ` [Qemu-devel] [PATCH 5/9] tcg: assign cpu->current_tb in a simpler place Paolo Bonzini
2015-08-26 0:17 ` [Qemu-devel] [PATCH 6/9] tcg: synchronize cpu->exit_request and cpu->tcg_exit_req accesses Paolo Bonzini
2015-08-28 2:19 ` Emilio G. Cota
2015-08-28 8:50 ` Paolo Bonzini
2015-08-26 0:17 ` [Qemu-devel] [PATCH 7/9] tcg: synchronize exit_request and tcg_current_cpu accesses Paolo Bonzini
2015-08-26 0:17 ` [Qemu-devel] [PATCH 8/9] use qemu_cpu_kick instead of cpu_exit or qemu_cpu_kick_thread Paolo Bonzini
2015-08-26 0:17 ` [Qemu-devel] [PATCH 9/9] tcg: signal-free qemu_cpu_kick Paolo Bonzini
2015-08-28 4:21 ` Richard Henderson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55DFE1BA.9050306@twiddle.net \
--to=rth@twiddle.net \
--cc=cota@braap.org \
--cc=mttcg@greensocs.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.