Skip to content

util/disk_cache: delete more cache items in one go when full

Timothy Arceri requested to merge tarceri/mesa:cache_delete_more into main

Currently the cache just deletes enough items when the cache is full to make room for the new item being stored. This hasn't been too much of a problem in practice but for things like running piglit where we have thousands of unique shaders and all threads being utilised we end up with a pretty big bottle neck.

With this change rather than just brute forcing our way to having enough room for the new item, we instead grab 10% of the least recently used items in the random directory we chose and delete them all. This should only be around 0.04% of total cache items but should hopefully releave some of the pressure on system calls like fstatat().

Merge request reports