diff options
| author | Paolo Bonzini | 2015-10-22 13:51:30 +0200 |
|---|---|---|
| committer | Michael Tokarev | 2015-11-06 13:42:38 +0100 |
| commit | 68851b98e5bf6d397498b74f1776801274ab8d48 (patch) | |
| tree | d773342247525f12874ae07ef39844bf2dd24558 /exec.c | |
| parent | target-alpha: fix uninitialized variable (diff) | |
| download | qemu-68851b98e5bf6d397498b74f1776801274ab8d48.tar.gz qemu-68851b98e5bf6d397498b74f1776801274ab8d48.tar.xz qemu-68851b98e5bf6d397498b74f1776801274ab8d48.zip | |
exec: avoid unnecessary cacheline bounce on ram_list.mru_block
Whenever the MRU cache hits for the list of RAM blocks, qemu_get_ram_block
does an unnecessary write that causes a processor cache line to bounce
from one core to another. This causes a performance hit.
Reported-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'exec.c')
| -rw-r--r-- | exec.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -903,7 +903,7 @@ static RAMBlock *qemu_get_ram_block(ram_addr_t addr) block = atomic_rcu_read(&ram_list.mru_block); if (block && addr - block->offset < block->max_length) { - goto found; + return block; } QLIST_FOREACH_RCU(block, &ram_list.blocks, next) { if (addr - block->offset < block->max_length) { |
