qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/3] qsp: QEMU's Synchronization Profiler


From: Emilio G. Cota
Subject: Re: [Qemu-devel] [PATCH 1/3] qsp: QEMU's Synchronization Profiler
Date: Thu, 16 Aug 2018 00:29:33 -0400
User-agent: Mutt/1.9.4 (2018-02-28)

On Wed, Aug 15, 2018 at 19:55:14 -0400, Emilio G. Cota wrote:
> On Wed, Aug 15, 2018 at 00:53:23 -0400, Emilio G. Cota wrote:
> > On Wed, Aug 15, 2018 at 11:09:42 +0800, Fam Zheng wrote:
> > > On Mon, 08/13 13:11, Emilio G. Cota wrote:
> > > > +  --enable-sync-profiler) sync_profiler="yes"
> > > > +  ;;
> > > 
> > > Curious, not asking for a change: can this be made a runtime option 
> > > instead of
> > > compile time, since there's no library dependencies? That should make this
> > > somewhat easier to use.
> > 
> > Good point. I'll do some profiling tomorrow to see how the latency
> > of the locking primitives could be minimized (ideally, not using
> > the profiler should just add a well-predicted branch).
> 
> I reduced it to just a branch, but still, I measured a few percentage
> points (1-2%, depending on the machine) slowdown when this is a
> run-time option. (This is for a bootup+shutdown test of a guest.)
> 
> So I'll keep it as a build-time option, then.

I looked further into this. Turns out we don't need the branch at all;
we can make indirect calls via function pointers, where the
pointers are set by qsp_enable/disable().

Overhead of doing things this way is within noise range, since
compilers and CPUs are so good at dealing with indirect calls.

I'll send a v2 tomorrow.

                Emilio



reply via email to

[Prev in Thread] Current Thread [Next in Thread]