[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 47/51] find_ram_offset: Align ram_addr_t allocation o
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 47/51] find_ram_offset: Align ram_addr_t allocation on long boundaries |
Date: |
Tue, 16 Jan 2018 15:17:29 +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 33/51] scripts/qemu-gdb: add simple tcg lock status helper, (continued)
- [Qemu-devel] [PULL 33/51] scripts/qemu-gdb: add simple tcg lock status helper, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 36/51] cpus: unify qemu_*_wait_io_event, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 41/51] chardev: Clean up previous patch indentation, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 38/51] net: Drop unusual use of do { } while (0);, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 39/51] mips: Tweak location of ';' in macros, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 40/51] chardev: Use goto/label instead of do/break/while(0), Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 42/51] tests: Avoid 'do/while(false); ' in vhost-user-bridge, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 43/51] maint: Fix macros with broken 'do/while(0); ' usage, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 45/51] cpu_physical_memory_sync_dirty_bitmap: Another alignment fix, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 44/51] checkpatch: Enforce proper do/while (0) style, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 47/51] find_ram_offset: Align ram_addr_t allocation on long boundaries,
Paolo Bonzini <=
- [Qemu-devel] [PULL 51/51] scripts/analyse-locks-simpletrace.py: script to analyse lock times, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 49/51] cpu: flush TB cache when loading VMState, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 46/51] find_ram_offset: Add comments and tracing, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 50/51] util/qemu-thread-*: add qemu_lock, locked and unlock trace events, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 48/51] block/iscsi: fix initialization of iTask in iscsi_co_get_block_status, Paolo Bonzini, 2018/01/16
- Re: [Qemu-devel] [PULL v4 00/51] Misc patches for 2018-01-12, no-reply, 2018/01/16
- Re: [Qemu-devel] [PULL v4 00/51] Misc patches for 2018-01-12, Peter Maydell, 2018/01/16