* [Qemu-devel] [PATCH] exec: fix ram_list dirty map optimization
@ 2014-01-30 12:03 Alexey Kardashevskiy
2014-02-04 15:00 ` Juan Quintela
0 siblings, 1 reply; 2+ messages in thread
From: Alexey Kardashevskiy @ 2014-01-30 12:03 UTC (permalink / raw)
To: qemu-devel; +Cc: Alexey Kardashevskiy, Paolo Bonzini, Juan Quintela
The ae2810c4bb3b383176e8e1b33931b16c01483aab patch introduced
optimization for ram_list.dirty_memory update. However it can only
work correctly if hpratio is 1 as the @bitmap parameter stores 1 bits
per system page size (may vary, 4K or 64K on PPC64) and
ram_list.dirty_memory stores 1 bit per TARGET_PAGE_SIZE
(which is hardcoded to 4K).
This fixes hpratio!=1 case to fall back to the slow path.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
include/exec/ram_addr.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h
index 33c8acc..6e83772 100644
--- a/include/exec/ram_addr.h
+++ b/include/exec/ram_addr.h
@@ -92,7 +92,8 @@ static inline void cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap,
unsigned long page = BIT_WORD(start >> TARGET_PAGE_BITS);
/* start address is aligned at the start of a word? */
- if (((page * BITS_PER_LONG) << TARGET_PAGE_BITS) == start) {
+ if ((((page * BITS_PER_LONG) << TARGET_PAGE_BITS) == start) &&
+ (hpratio == 1)) {
long k;
long nr = BITS_TO_LONGS(pages);
--
1.8.4.rc4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] exec: fix ram_list dirty map optimization
2014-01-30 12:03 [Qemu-devel] [PATCH] exec: fix ram_list dirty map optimization Alexey Kardashevskiy
@ 2014-02-04 15:00 ` Juan Quintela
0 siblings, 0 replies; 2+ messages in thread
From: Juan Quintela @ 2014-02-04 15:00 UTC (permalink / raw)
To: Alexey Kardashevskiy; +Cc: Paolo Bonzini, qemu-devel
Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
> The ae2810c4bb3b383176e8e1b33931b16c01483aab patch introduced
> optimization for ram_list.dirty_memory update. However it can only
> work correctly if hpratio is 1 as the @bitmap parameter stores 1 bits
> per system page size (may vary, 4K or 64K on PPC64) and
> ram_list.dirty_memory stores 1 bit per TARGET_PAGE_SIZE
> (which is hardcoded to 4K).
>
> This fixes hpratio!=1 case to fall back to the slow path.
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Juan Quintela <quintela@redhat.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-02-04 15:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-30 12:03 [Qemu-devel] [PATCH] exec: fix ram_list dirty map optimization Alexey Kardashevskiy
2014-02-04 15:00 ` Juan Quintela
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).