qemu-trivial
[Top][All Lists]
Advanced

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

[Qemu-trivial] [PULL 21/24] exec: avoid unnecessary cacheline bounce on


From: Michael Tokarev
Subject: [Qemu-trivial] [PULL 21/24] exec: avoid unnecessary cacheline bounce on ram_list.mru_block
Date: Fri, 6 Nov 2015 15:43:58 +0300

From: Paolo Bonzini <address@hidden>

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 <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
 exec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/exec.c b/exec.c
index ed88e72..a028961 100644
--- a/exec.c
+++ b/exec.c
@@ -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) {
-- 
2.1.4




reply via email to

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