All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] xbzrle: page may not be update if it has been in the cache
@ 2014-04-02  8:56 arei.gonglei
  2014-04-04 15:04 ` Eric Blake
  0 siblings, 1 reply; 2+ messages in thread
From: arei.gonglei @ 2014-04-02  8:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: ChenLiang, quintela, dgilbert, owasserm, Gonglei, pbonzini

From: ChenLiang <chenliang88@huawei.com>

The cache_insert don't check whether the page has been in the cache.

Signed-off-by: ChenLiang <chenliang88@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 page_cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/page_cache.c b/page_cache.c
index c78157b..78f7590 100644
--- a/page_cache.c
+++ b/page_cache.c
@@ -171,7 +171,7 @@ 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 &&
+    if (it->it_data && it->it_addr != addr &&
         it->it_age + CACHED_PAGE_LIFETIME > current_age) {
         /* the cache page is fresh, don't replace it */
         return -1;
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] xbzrle: page may not be update if it has been in the cache
  2014-04-02  8:56 [Qemu-devel] [PATCH] xbzrle: page may not be update if it has been in the cache arei.gonglei
@ 2014-04-04 15:04 ` Eric Blake
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Blake @ 2014-04-04 15:04 UTC (permalink / raw)
  To: arei.gonglei, qemu-devel
  Cc: ChenLiang, owasserm, pbonzini, dgilbert, quintela

[-- Attachment #1: Type: text/plain, Size: 1060 bytes --]

On 04/02/2014 02:56 AM, arei.gonglei@huawei.com wrote:
> From: ChenLiang <chenliang88@huawei.com>
> 
> The cache_insert don't check whether the page has been in the cache.
> 
> Signed-off-by: ChenLiang <chenliang88@huawei.com>
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> ---
>  page_cache.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/page_cache.c b/page_cache.c
> index c78157b..78f7590 100644
> --- a/page_cache.c
> +++ b/page_cache.c
> @@ -171,7 +171,7 @@ 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 &&
> +    if (it->it_data && it->it_addr != addr &&
>          it->it_age + CACHED_PAGE_LIFETIME > current_age) {
>          /* the cache page is fresh, don't replace it */
>          return -1;
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-04 15:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-02  8:56 [Qemu-devel] [PATCH] xbzrle: page may not be update if it has been in the cache arei.gonglei
2014-04-04 15:04 ` Eric Blake

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.