ccache's cleanup algorithm

RW rwmaillists at googlemail.com
Tue Nov 3 14:15:27 UTC 2015


On Tue, 03 Nov 2015 07:26:46 -0600
Scott Bennett wrote:

>      In ccache's cleanup.c module, the comments say that files are
> deleted from the cache on a LRU basis.  However, the code refers to
> mtime, not atime, so it appears that ccache is, in reality, using a
> Least Recently *Modified* basis upon which to expire files from the
> cache.  Is that really what ccache does?  Or did I miss something?
> If it's really using LRM instead of LRU, can anyone explain why?


That did use to be the case a long time ago, but I wrote a patch to
update the mtimes after a cache hit. The mtime updates are still there,
see from_cache() in ccache.c.

Using the file atimes wouldn't work well because they can be
accidentally updated by file searches, and  a lot of filesytems
are mounted with noatime anyway.


More information about the freebsd-ports mailing list