[Mesa-dev] [PATCH 4/5] util/disk_cache: actually enforce cache size
Grazvydas Ignotas
notasas at gmail.com
Tue Mar 14 12:00:15 UTC 2017
On Tue, Mar 14, 2017 at 4:08 AM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
> From: Alan Swanson <reiver at improbability.net>
>
> Currently only a one in one out eviction so if at max_size and
> cache files were to constantly increase in size then so would the
> cache. Restrict to limit of 8 evictions per new cache entry.
>
> V2: (Timothy Arceri) fix make check tests
> ---
> src/compiler/glsl/tests/cache_test.c | 22 +++++++++++++++++++---
> src/util/disk_cache.c | 6 +++++-
> 2 files changed, 24 insertions(+), 4 deletions(-)
>
> diff --git a/src/compiler/glsl/tests/cache_test.c b/src/compiler/glsl/tests/cache_test.c
> index 10505d4..5ad438c 100644
> --- a/src/compiler/glsl/tests/cache_test.c
> +++ b/src/compiler/glsl/tests/cache_test.c
> @@ -345,30 +345,38 @@ test_put_and_get(void)
> * finish.
> */
> wait_until_file_written(cache, one_KB_key);
>
> result = disk_cache_get(cache, one_KB_key, &size);
> expect_non_null(result, "3rd disk_cache_get of existing item (pointer)");
> expect_equal(size, 1024, "3rd disk_cache_get of existing item (size)");
>
> free(result);
>
> - /* Ensure eviction happened by checking that only one of the two
> - * previously-added items can still be fetched.
> + /* Ensure eviction happened by checking that both of the previous
> + * cache itesm were evicted.
items
for patches 2-5:
Reviewed-by: Grazvydas Ignotas <notasas at gmail.com>
More information about the mesa-dev
mailing list