On Thu, Feb 05, 2015 at 03:17:19PM +0100, Kevin Wolf wrote:

> > By never allowing the hit count to go down to zero, we make sure
> > that all unused entries are chosen first before a valid one is
> > discarded.
> 
> But does this actually improve a lot? cache_hits is only 0 for the
> first few accesses and it never becomes 0 again after that. The
> result might be that soon all the entries have cache_hits == 1, and
> we get the same problem as you're describing - only the first few
> entries will be reused.

I targeted the specific case where the size of the L2 cache is set so
that it's big enough for the whole disk.

I have a setup with a 16GB disk image and a 2MB L2 cache (that's 32
entries). If I do random rw, after two minutes I get an average of 3K
IOPS, and more than half (19) of the cache entries are still unused.

With the patch the cache fills up immediately and I get sustained ~20K
IOPS from the very beginning.

Berto

Reply via email to