* ???? (chenliang0...@icloud.com) wrote:

<snip>

> 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 / dgilb...@redhat.com / Manchester, UK
> > 
> 
--
Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK

Reply via email to