[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 12:33:29 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
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.
Paolo
- [Qemu-devel] [PATCH 00/16] tcg: tb_lock removal redux v1, Emilio G. Cota, 2018/02/27
- [Qemu-devel] [PATCH 07/16] translate-all: remove hole in PageDesc, Emilio G. Cota, 2018/02/27
- [Qemu-devel] [PATCH 06/16] translate-all: make l1_map lockless, Emilio G. Cota, 2018/02/27
- [Qemu-devel] [PATCH 09/16] translate-all: move tb_invalidate_phys_page_range up in the file, Emilio G. Cota, 2018/02/27
- [Qemu-devel] [PATCH 12/16] translate-all: discard TB when tb_link_page returns an existing matching TB, Emilio G. Cota, 2018/02/27
- [Qemu-devel] [PATCH 01/16] qht: require a default comparison function, Emilio G. Cota, 2018/02/27