From: Stefan Hajnoczi <stefanha@redhat.com>
To: "Lluís Vilanova" <vilanova@ac.upc.edu>
Cc: qemu-devel@nongnu.org, Eric Blake <eblake@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 0/5] trace: [tcg] Optimize per-vCPU tracing states with separate TB caches
Date: Mon, 26 Sep 2016 14:37:55 +0100 [thread overview]
Message-ID: <20160926133755.GC14950@stefanha-x1.localdomain> (raw)
In-Reply-To: <147395463702.2399.17485798724867278064.stgit@fimbulvetr.bsc.es>
[-- Attachment #1: Type: text/plain, Size: 2265 bytes --]
On Thu, Sep 15, 2016 at 05:50:37PM +0200, Lluís Vilanova wrote:
> Avoids generating TCG code to call guest code tracing events in vCPUs that are
> not dynamically tracing that event.
>
> Currently, events with the 'tcg' property always generate TCG code to trace that
> event at guest code execution time, when their dynamic tracing state is checked.
>
> This series adds a performance optimization where TCG code for events with the
> 'tcg' and 'vcpu' properties is not generated if the event is dynamically
> disabled. This optimization raises two issues:
>
> * An event can be dynamically disabled/enabled after the corresponding TCG code
> has been generated (i.e., a new TB with the corresponding code should be
> used).
>
> * Each vCPU can have a different dynamic state for the same event (i.e., tracing
> the memory accesses of only one process pinned to a vCPU).
>
> To handle both issues, this series replicates the shared physical TB cache,
> creating a separate physical TB cache for every combination of event states
> (those with the 'vcpu' and 'tcg' properties). Then, all vCPUs tracing the same
> events will use the same physical TB cache.
>
> Sharing physical TBs makes this very space efficient (only the physical TB
> caches, simple arrays of pointers, are replicated), sharing physical TB caches
> maximizes TB reuse across vCPUs whenever possible, and makes dynamic event state
> changes more efficient (simply use a different TB array).
>
> The physical TB cache array is indexed with the vCPU's trace event state
> bitmask. This is simpler and more efficient than emitting TCG code to check if
> an event needs tracing; then we should still move the tracing call code to
> either a cold path (making tracing performance worse), or leave it inlined
> (making non-tracing performance worse).
>
> It is also more efficient than eliding TCG code only when *zero* vCPUs are
> tracing an event, since enabling it on a single vCPU will impact the performance
> of all other vCPUs that are not tracing that event.
>
> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
> ---
TCG folks?
The design of this patch is more related to TCG than tracing since it
affects TB caching.
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
prev parent reply other threads:[~2016-09-26 13:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-15 15:50 [Qemu-devel] [PATCH v2 0/5] trace: [tcg] Optimize per-vCPU tracing states with separate TB caches Lluís Vilanova
2016-09-15 15:50 ` [Qemu-devel] [PATCH v2 1/5] exec: [tcg] Refactor flush of per-CPU virtual TB cache Lluís Vilanova
2016-09-15 15:50 ` [Qemu-devel] [PATCH v2 2/5] exec: [tcg] Use multiple physical TB caches Lluís Vilanova
2016-09-15 15:50 ` [Qemu-devel] [PATCH v2 3/5] exec: [tcg] Switch physical TB cache based on vCPU tracing state Lluís Vilanova
2016-09-15 15:50 ` [Qemu-devel] [PATCH v2 4/5] trace: [tcg] Do not generate TCG code to trace dinamically-disabled events Lluís Vilanova
2016-09-26 13:41 ` Stefan Hajnoczi
2016-09-26 16:12 ` Lluís Vilanova
2016-09-15 15:51 ` [Qemu-devel] [PATCH v2 5/5] trace: [tcg, trivial] Re-align generated code Lluís Vilanova
2016-09-26 13:37 ` Stefan Hajnoczi [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=20160926133755.GC14950@stefanha-x1.localdomain \
--to=stefanha@redhat.com \
--cc=eblake@redhat.com \
--cc=ehabkost@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=vilanova@ac.upc.edu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).