qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 03/10] XBZRLE: optimize XBZRLE to decrease the c


From: Juan Quintela
Subject: Re: [Qemu-devel] [PATCH 03/10] XBZRLE: optimize XBZRLE to decrease the cache missing
Date: Tue, 11 Mar 2014 21:34:09 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

<address@hidden> wrote:
> From: ChenLiang <address@hidden>
>
> Avoid the hot pages being replaced by others to remarkable decrease cache
> missing. The counter of updating dirty bitmap is used to indicate the cached
> page age.
>
> Signed-off-by: ChenLiang <address@hidden>
> Signed-off-by: Gonglei <address@hidden>


>  /**
>   * get_cached_data: Get the data cached for an addr
> @@ -60,13 +62,15 @@ uint8_t *get_cached_data(const PageCache *cache, uint64_t 
> addr);
>   * cache_insert: insert the page into the cache. the page cache
>   * will dup the data on insert. the previous value will be overwritten
>   *
> - * Returns -1 on error
> + * Returns -1 when the page isn't be inserted into cache


s/be//?

>   *
>   * @cache pointer to the PageCache struct
>   * @addr: page address
>   * @pdata: pointer to the page
> + * @current_age indicate the age of the page if the page is inserted into 
> cache

missing colon.

   * @current_age: current bitmap generation



> @@ -161,6 +171,11 @@ int cache_insert(PageCache *cache, uint64_t addr, const 
> uint8_t *pdata)
>      /* actual update of entry */
>      it = cache_get_by_addr(cache, addr);
>  
> +    if ((it->it_data != NULL) && (it->it_age +
> +        CACHED_PAGE_LIFETIME > current_age)) {
> +        /* the cache page is fresh, don't replace it */

Should we add a counter for this "misses"?  It is a question to know how
much it happens.

BTW, do you have any benchmark/numbers showing that this is a good idea?

Thanks, Juan.



reply via email to

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