[Mesa-dev] [PATCH 1/2] disk_cache: reduce default cache size to 5% of filesystem

Timothy Arceri tarceri at itsqueeze.com
Thu Apr 27 01:15:29 UTC 2017


Modern disks are extremely large and are only going to get bigger.
Usage has shown frequent Mesa upgrades can result in the cache
growing very fast i.e. wasting a lot of disk space unnecessarily.

5% seems like a more reasonable default.

Cc: "17.1" <mesa-stable at lists.freedesktop.org>
---
 src/util/disk_cache.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
index d9de8ef..9fd7b96 100644
--- a/src/util/disk_cache.c
+++ b/src/util/disk_cache.c
@@ -324,24 +324,24 @@ disk_cache_create(const char *gpu_name, const char *timestamp)
          case '\0':
          case 'G':
          case 'g':
          default:
             max_size *= 1024*1024*1024;
             break;
          }
       }
    }
 
-   /* Default to 1GB or 10% of filesystem for maximum cache size. */
+   /* Default to 1GB or 5% of filesystem for maximum cache size. */
    if (max_size == 0) {
       statvfs(path, &vfs);
-      max_size = MAX2(1024*1024*1024, vfs.f_blocks * vfs.f_bsize / 10);
+      max_size = MAX2(1024*1024*1024, vfs.f_blocks * vfs.f_bsize / 20);
    }
 
    cache->max_size = max_size;
 
    /* A limit of 32 jobs was choosen as observations of Deus Ex start-up times
     * showed that we reached at most 11 jobs on an Intel i5-6400 CPU at 2.70GHz
     * (a fairly modest desktop CPU). 1 thread was chosen because we don't
     * really care about getting things to disk quickly just that it's not
     * blocking other tasks.
     */
-- 
2.9.3



More information about the mesa-dev mailing list