From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVjXF-0005c5-U3 for qemu-devel@nongnu.org; Thu, 03 Apr 2014 11:26:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVjXA-0004AY-9g for qemu-devel@nongnu.org; Thu, 03 Apr 2014 11:26:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44186) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVjXA-0004AR-1g for qemu-devel@nongnu.org; Thu, 03 Apr 2014 11:26:28 -0400 Date: Thu, 3 Apr 2014 15:40:02 +0100 From: "Dr. David Alan Gilbert" Message-ID: <20140403144002.GD2658@work-vm> References: <1395890303-7880-1-git-send-email-arei.gonglei@huawei.com> <1395890303-7880-6-git-send-email-arei.gonglei@huawei.com> <20140401164719.GP2411@work-vm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v4 5/8] XBZRLE: optimize XBZRLE to decrease the cache misses List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: ???? Cc: ChenLiang , arei.gonglei@huawei.com, weidong.huang@huawei.com, qemu-devel@nongnu.org, pbonzini@redhat.com * ???? (chenliang0016@icloud.com) wrote: > Hi Dave, is it ok? > > - if (it->it_data && > + if (it->it_data && it->it_addr != addr && > it->it_age + CACHED_PAGE_LIFETIME > current_age) { > I've not had a chance to retry it yet; did you try google stressapptest on it? Dave > ChenLiang > >> + return -1; > >> + } > >> /* allocate page */ > >> if (!it->it_data) { > >> it->it_data = g_try_malloc(cache->page_size); > >> @@ -173,7 +188,7 @@ int cache_insert(PageCache *cache, uint64_t addr, const uint8_t *pdata) > >> > >> memcpy(it->it_data, pdata, cache->page_size); > >> > >> - it->it_age = ++cache->max_item_age; > >> + it->it_age = current_age; > >> it->it_addr = addr; > >> > >> return 0; > >> -- > >> 1.7.12.4 > >> > >> > >> > > -- > > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK > > > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK