qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 1/4] memory: introduce DIRTY_MEMORY_DIRTY_RATE dirty bits


From: Peter Xu
Subject: Re: [PATCH 1/4] memory: introduce DIRTY_MEMORY_DIRTY_RATE dirty bits
Date: Fri, 9 Jul 2021 14:37:14 -0400

On Sun, Jun 27, 2021 at 01:38:14PM +0800, huangy81@chinatelecom.cn wrote:
> @@ -370,9 +374,17 @@ static inline void 
> cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap,
>                      qatomic_or(&blocks[DIRTY_MEMORY_VGA][idx][offset], temp);
>  
>                      if (global_dirty_tracking) {
> -                        qatomic_or(
> +                        if (global_dirty_tracking & GLOBAL_DIRTY_MIGRATION) {
> +                            qatomic_or(
>                                  &blocks[DIRTY_MEMORY_MIGRATION][idx][offset],
>                                  temp);
> +                        }
> +
> +                        if (global_dirty_tracking & GLOBAL_DIRTY_DIRTY_RATE) 
> {
> +                            qatomic_or(
> +                                
> &blocks[DIRTY_MEMORY_DIRTY_RATE][idx][offset],
> +                                temp);

So what I meant in the other thread is instead of operating on this bitmap we
just record the number of total dirty pages, just like we used to do with rings.

PS. IIUC maybe this can even work for dirty rings.. because either dirty ring
or dirty logging collect dirty bits into the slot bitmap, then it's further
aggregated here from the slot bitmaps.  However merging them won't help much
because dirty ring can provide finer-granule per-vcpu dirty info, which can be
further used for per-vcpu throttling in the future.  So just raise this up.

> +                        }
>                      }

-- 
Peter Xu




reply via email to

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