This is an archive of the discontinued LLVM Phabricator instance.

CachePruning: Allow limiting the number of files in the cache directory.
ClosedPublic

Authored by pcc on Nov 21 2017, 5:49 PM.

Details

Summary

The default limit is 1000000 but it can be configured with a cache
policy. The motivation is that some filesystems (notably ext4) have
a limit on the number of files that can be contained in a directory
(separate from the inode limit).

Diff Detail

Repository
rL LLVM

Event Timeline

pcc created this revision.Nov 21 2017, 5:49 PM
tejohnson added inline comments.
llvm/lib/Support/CachePruning.cpp
232 ↗(On Diff #123871)

I think you will need to change the way ShouldComputeSize is set above (i.e. OR in Policy.MaxSizeFiles > 0) to ensure it is true and therefore FileSizes and TotalSize have been computed at this point.

pcc updated this revision to Diff 123973.Nov 22 2017, 10:09 AM
pcc marked an inline comment as done.
  • Bug fixes
pcc added inline comments.
llvm/lib/Support/CachePruning.cpp
232 ↗(On Diff #123871)

Done, also fixed a bug where we were exiting early above, and another bug where prune_after=0s did not behave as documented.

This revision is now accepted and ready to land.Nov 22 2017, 10:22 AM
This revision was automatically updated to reflect the committed changes.