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: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 13/16] translate-all: protect TB jumps with a per-destination-TB lock
Date: Tue, 27 Feb 2018 15:31:16 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 27/02/2018 12:43, Laurent Desnogues wrote:
> 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 :-)

Jumps are only chained within the same page, so probably only the
smaller buckets can be for calls.

Paolo



reply via email to

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