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 <be...@igalia.com> > --- > block/qcow2-cache.c | 31 +++++++++++++++---------------- > 1 file changed, 15 insertions(+), 16 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>
pgpaKPHOt8X3o.pgp
Description: PGP signature