mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-04-20 16:41:46 +00:00
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. Backports commit 68851b98e5bf6d397498b74f1776801274ab8d48 from qemu
This commit is contained in:
parent
e1a4e4208f
commit
479f36ef8e
|
@ -683,7 +683,7 @@ static RAMBlock *qemu_get_ram_block(struct uc_struct *uc, ram_addr_t addr)
|
|||
/* The list is protected by the iothread lock here. */
|
||||
block = uc->ram_list.mru_block;
|
||||
if (block && addr - block->offset < block->max_length) {
|
||||
goto found;
|
||||
return block;
|
||||
}
|
||||
QTAILQ_FOREACH(block, &uc->ram_list.blocks, next) {
|
||||
if (addr - block->offset < block->max_length) {
|
||||
|
|
Loading…
Reference in a new issue