qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 13/16] translate-all: protect TB jumps with a pe


From: Laurent Desnogues
Subject: Re: [Qemu-devel] [PATCH 13/16] translate-all: protect TB jumps with a per-destination-TB lock
Date: Tue, 27 Feb 2018 12:43:59 +0100

On Tue, Feb 27, 2018 at 12:33 PM, Paolo Bonzini <address@hidden> wrote:
> On 27/02/2018 06:39, Emilio G. Cota wrote:
>> Using a hash table or a binary tree to keep track of the jumps
>> doesn't really pay off, not only due to the increased memory usage,
>> but also because most TBs have only 0 or 1 jumps to them. The maximum
>> number of jumps when booting debian-arm that I measured is 35, but
>> as we can see in the histogram below a TB with that many incoming jumps
>> is extremely rare; the average TB has 0.80 incoming jumps.
>>
>> n_jumps: 379208; avg jumps/tb: 0.801099
>> dist: [0.0,1.0)|▄█▁▁▁▁▁▁▁▁▁▁▁ ▁▁▁▁▁▁ ▁▁▁  ▁▁▁     ▁|[34.0,35.0]
>
> This makes sense, for example:
>
>    while(...) {
>    }
>
> 2 basic blocks, 0 and 1 incoming jumps (avg 0.5)
>
>    if(...) {
>    }
>
> 2 basic blocks, 0 and 1 incoming jumps (avg 0.5)
>
>    if(...) {
>    } else {
>    }
>
> 3 basic blocks, 0, 1 and 1 incoming jumps (avg 0.66)
>
> So 0.8 is actually a lot. :)  The long tail is probably for switch
> statements.

And calls too :-)


Laurent

> Paolo
>



reply via email to

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