[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 3/7] qcow2: use an LRU algorithm to replace entr
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-block] [PATCH 3/7] qcow2: use an LRU algorithm to replace entries from the L2 cache |
Date: |
Thu, 7 May 2015 11:16:53 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Wed, May 06, 2015 at 04:39:27PM +0300, Alberto Garcia wrote:
> The current algorithm to evict entries from the cache gives always
> preference to those in the lowest positions. As the size of the cache
> increases, the chances of the later elements of being removed decrease
> exponentially.
>
> In a scenario with random I/O and lots of cache misses, entries in
> positions 8 and higher are rarely (if ever) evicted. This can be seen
> even with the default cache size, but with larger caches the problem
> becomes more obvious.
>
> Using an LRU algorithm makes the chances of being removed from the
> cache independent from the position.
>
> Signed-off-by: Alberto Garcia <address@hidden>
> ---
> block/qcow2-cache.c | 31 +++++++++++++++----------------
> 1 file changed, 15 insertions(+), 16 deletions(-)
Reviewed-by: Stefan Hajnoczi <address@hidden>
pgpAOCdtZxQzZ.pgp
Description: PGP signature
- Re: [Qemu-block] [PATCH 4/7] qcow2: remove qcow2_cache_find_entry_to_replace(), (continued)