All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: arei.gonglei@huawei.com, qemu-devel@nongnu.org
Cc: ChenLiang <chenliang88@huawei.com>,
	owasserm@redhat.com, pbonzini@redhat.com, dgilbert@redhat.com,
	quintela@redhat.com
Subject: Re: [Qemu-devel] [PATCH] xbzrle: page may not be update if it has been in the cache
Date: Fri, 04 Apr 2014 09:04:01 -0600	[thread overview]
Message-ID: <533EC9E1.1090109@redhat.com> (raw)
In-Reply-To: <1396428990-2516-1-git-send-email-arei.gonglei@huawei.com>

[-- 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 --]

      reply	other threads:[~2014-04-04 15:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=533EC9E1.1090109@redhat.com \
    --to=eblake@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=chenliang88@huawei.com \
    --cc=dgilbert@redhat.com \
    --cc=owasserm@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.