[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 48/52] find_ram_offset: Align ram_addr_t allocation o
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 48/52] find_ram_offset: Align ram_addr_t allocation on long boundaries |
Date: |
Fri, 12 Jan 2018 12:31:12 +0100 |
From: "Dr. David Alan Gilbert" <address@hidden>
The dirty bitmaps are built from 'long's and there is fast-path code
for synchronising the case where the RAMBlock is aligned to the start
of a long boundary. Align the allocation to this boundary
to cause the fast path to be used.
Offsets before change:
address@hidden:find_ram_offset size: 0x1e0000 @ 0x8000000
address@hidden:find_ram_offset size: 0x20000 @ 0x81e0000
address@hidden:find_ram_offset size: 0x20000 @ 0x8200000
address@hidden:find_ram_offset size: 0x1000000 @ 0x8220000
address@hidden:find_ram_offset size: 0x10000 @ 0x9220000
address@hidden:find_ram_offset size: 0x40000 @ 0x9230000
address@hidden:find_ram_offset size: 0x200000 @ 0x9270000
address@hidden:find_ram_offset size: 0x1000 @ 0x9470000
address@hidden:find_ram_offset size: 0x1000 @ 0x9471000
after change:
address@hidden:find_ram_offset size: 0x1e0000 @ 0x8000000
address@hidden:find_ram_offset size: 0x20000 @ 0x8200000
address@hidden:find_ram_offset size: 0x20000 @ 0x8240000
address@hidden:find_ram_offset size: 0x1000000 @ 0x8280000
address@hidden:find_ram_offset size: 0x10000 @ 0x9280000
address@hidden:find_ram_offset size: 0x40000 @ 0x92c0000
address@hidden:find_ram_offset size: 0x200000 @ 0x9300000
address@hidden:find_ram_offset size: 0x1000 @ 0x9500000
address@hidden:find_ram_offset size: 0x1000 @ 0x9540000
Suggested-by: Paolo Bonzini <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
exec.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/exec.c b/exec.c
index 5e2fb55..9f4f450 100644
--- a/exec.c
+++ b/exec.c
@@ -1678,7 +1678,11 @@ static ram_addr_t find_ram_offset(ram_addr_t size)
RAMBLOCK_FOREACH(block) {
ram_addr_t candidate, next = RAM_ADDR_MAX;
+ /* Align blocks to start on a 'long' in the bitmap
+ * which makes the bitmap sync'ing take the fast path.
+ */
candidate = block->offset + block->max_length;
+ candidate = ROUND_UP(candidate, BITS_PER_LONG << TARGET_PAGE_BITS);
/* Search for the closest following block
* and find the gap.
--
1.8.3.1
- [Qemu-devel] [PULL 37/52] icount: fixed saving/restoring of icount warp timers, (continued)
- [Qemu-devel] [PULL 37/52] icount: fixed saving/restoring of icount warp timers, Paolo Bonzini, 2018/01/12
- [Qemu-devel] [PULL 43/52] chardev: Clean up previous patch indentation, Paolo Bonzini, 2018/01/12
- [Qemu-devel] [PULL 38/52] cpus: unify qemu_*_wait_io_event, Paolo Bonzini, 2018/01/12
- [Qemu-devel] [PULL 39/52] irq: fix memory leak, Paolo Bonzini, 2018/01/12
- [Qemu-devel] [PULL 41/52] mips: Tweak location of ';' in macros, Paolo Bonzini, 2018/01/12
- [Qemu-devel] [PULL 42/52] chardev: Use goto/label instead of do/break/while(0), Paolo Bonzini, 2018/01/12
- [Qemu-devel] [PULL 44/52] tests: Avoid 'do/while(false); ' in vhost-user-bridge, Paolo Bonzini, 2018/01/12
- [Qemu-devel] [PULL 46/52] checkpatch: Enforce proper do/while (0) style, Paolo Bonzini, 2018/01/12
- [Qemu-devel] [PULL 45/52] maint: Fix macros with broken 'do/while(0); ' usage, Paolo Bonzini, 2018/01/12
- [Qemu-devel] [PULL 40/52] net: Drop unusual use of do { } while (0);, Paolo Bonzini, 2018/01/12
- [Qemu-devel] [PULL 48/52] find_ram_offset: Align ram_addr_t allocation on long boundaries,
Paolo Bonzini <=
- [Qemu-devel] [PULL 49/52] block/iscsi: fix initialization of iTask in iscsi_co_get_block_status, Paolo Bonzini, 2018/01/12
- [Qemu-devel] [PULL 50/52] cpu: flush TB cache when loading VMState, Paolo Bonzini, 2018/01/12
- [Qemu-devel] [PULL 52/52] scripts/analyse-locks-simpletrace.py: script to analyse lock times, Paolo Bonzini, 2018/01/12
- [Qemu-devel] [PULL 51/52] util/qemu-thread-*: add qemu_lock, locked and unlock trace events, Paolo Bonzini, 2018/01/12
- [Qemu-devel] [PULL 47/52] find_ram_offset: Add comments and tracing, Paolo Bonzini, 2018/01/12