On 27/04/17 10:15 AM, Timothy Arceri wrote: > The majority of cache files are less than 1kb this resulted in us > greatly miscalculating the amount of disk space used by the cache. > > Using the number of blocks allocated to the file is more > conservative and less likely to cause issues. > > This change will result in cache sizes being miscalculated further > until old items added with the previous calculation have all been > removed. However I don't see anyway around that, the previous > patch should help limit that problem. > > Cc: "17.1" <mesa-sta...@lists.freedesktop.org>
[...] > - if (sb.st_size) > - p_atomic_add(cache->size, - (uint64_t)sb.st_size); > + if (sb.st_blocks * 512) > + p_atomic_add(cache->size, - (uint64_t)sb.st_blocks * 512); No need to multiply by 512 here. With that removed, Reviewed-and-Tested-by: Michel Dänzer <michel.daen...@amd.com> -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev