[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 27/29] memory: replace cpu_physical_memory_re
From: |
Aurelien Jarno |
Subject: |
Re: [Qemu-devel] [PATCH v3 27/29] memory: replace cpu_physical_memory_reset_dirty() with test-and-clear |
Date: |
Wed, 27 May 2015 00:40:03 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On 2015-05-26 18:55, Paolo Bonzini wrote:
> From: Stefan Hajnoczi <address@hidden>
>
> The cpu_physical_memory_reset_dirty() function is sometimes used
> together with cpu_physical_memory_get_dirty(). This is not atomic since
> two separate accesses to the dirty memory bitmap are made.
>
> Turn cpu_physical_memory_reset_dirty() and
> cpu_physical_memory_clear_dirty_range_type() into the atomic
> cpu_physical_memory_test_and_clear_dirty().
>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> Message-Id: <address@hidden>
> Reviewed-by: Fam Zheng <address@hidden>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> cputlb.c | 4 ++--
> exec.c | 23 +++++++++++++++++------
> include/exec/ram_addr.h | 33 ++++++++++-----------------------
> memory.c | 11 ++++-------
> 4 files changed, 33 insertions(+), 38 deletions(-)
...
> diff --git a/exec.c b/exec.c
> index 4cd18ff..7552363 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -856,16 +856,27 @@ static void tlb_reset_dirty_range_all(ram_addr_t start,
> ram_addr_t length)
> }
>
> /* Note: start and end must be within the same ram block. */
> -void cpu_physical_memory_reset_dirty(ram_addr_t start, ram_addr_t length,
> - unsigned client)
> +bool cpu_physical_memory_test_and_clear_dirty(ram_addr_t start,
> + ram_addr_t length,
> + unsigned client)
> {
> - if (length == 0)
> - return;
> - cpu_physical_memory_clear_dirty_range_type(start, length, client);
> + unsigned long end, page;
> + bool dirty;
> +
^
git am complains about the above added space.
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
address@hidden http://www.aurel32.net
- [Qemu-devel] [PATCH v3 14/29] exec: use memory_region_get_dirty_log_mask to optimize dirty tracking, (continued)
- [Qemu-devel] [PATCH v3 14/29] exec: use memory_region_get_dirty_log_mask to optimize dirty tracking, Paolo Bonzini, 2015/05/26
- [Qemu-devel] [PATCH v3 25/29] memory: use atomic ops for setting dirty memory bits, Paolo Bonzini, 2015/05/26
- [Qemu-devel] [PATCH v3 06/29] memory: prepare for multiple bits in the dirty log mask, Paolo Bonzini, 2015/05/26
- [Qemu-devel] [PATCH v3 17/29] cputlb: remove useless arguments to tlb_unprotect_code_phys, rename, Paolo Bonzini, 2015/05/26
- [Qemu-devel] [PATCH v3 26/29] migration: move dirty bitmap sync to ram_addr.h, Paolo Bonzini, 2015/05/26
- [Qemu-devel] [PATCH v3 12/29] kvm: remove special handling of DIRTY_MEMORY_MIGRATION in the dirty log mask, Paolo Bonzini, 2015/05/26
- [Qemu-devel] [PATCH v3 08/29] ui/console: remove dpy_gfx_update_dirty, Paolo Bonzini, 2015/05/26
- [Qemu-devel] [PATCH v3 27/29] memory: replace cpu_physical_memory_reset_dirty() with test-and-clear, Paolo Bonzini, 2015/05/26
- Re: [Qemu-devel] [PATCH v3 27/29] memory: replace cpu_physical_memory_reset_dirty() with test-and-clear,
Aurelien Jarno <=
- [Qemu-devel] [PATCH v3 28/29] memory: make cpu_physical_memory_sync_dirty_bitmap() fully atomic, Paolo Bonzini, 2015/05/26
- [Qemu-devel] [PATCH v3 29/29] memory: use mr->ram_addr in "is this RAM?" assertions, Paolo Bonzini, 2015/05/26
- Re: [Qemu-devel] [PATCH v3 00/29] Dirty bitmap atomic access and optimizations, Aurelien Jarno, 2015/05/26