diff options
author | Juston Li <justonli@google.com> | 2022-10-24 20:03:56 +0000 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-01-16 16:15:45 +0000 |
commit | 3b69b67545b678da2970654b9490cc3902cdf738 (patch) | |
tree | d27f1a0a4d0c11b3c6ead644ef70ddfa166c7c59 /docs | |
parent | eea2033b3efe657ac9129fd44c5bce371040eb04 (diff) |
util/fossilize_db: add runtime RO foz db loading via FOZ_DBS_DYNAMIC_LIST
Add a new environment varible
MESA_DISK_CACHE_READ_ONLY_FOZ_DBS_DYNAMICE_LIST that specifies a text
file containing a list of RO fossilize caches to load. The list file
is modifiable at runtime to allow for loading RO caches after
initialization unlike MESA_DISK_CACHE_READ_ONLY_FOZ_DBS.
The implementation spawns an updater thread that uses inotify to monitor
the list file for modifications, attempting to load new foz dbs added to
the list. Removing files from the list will not evict a loaded cache.
MESA_DISK_CACHE_READ_ONLY_FOZ_DBS_DYNAMIC_LIST takes an absolute path.
The file must exist at initialization for updating to occur.
File names of foz dbs in the list file are new-line separated and take
relative paths to the default cache directory like
MESA_DISK_CACHE_READ_ONLY_FOZ_DBS.
The maximum number of RO foz dbs is kept to 8 and is shared between
MESA_DISK_CACHE_READ_ONLY_FOZ_DBS_DYNAMIC_LIST and
MESA_DISK_CACHE_READ_ONLY_FOZ_DBS.
The intended use case for this feature is to allow prebuilt caches
to be downloaded and loaded asynchronously during app runtime.
Prebuilt caches be large (several GB) and depending on network
conditions would otherwise present extended wait time for caches
to be availible before app launch.
This will be used in Chrome OS.
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19328>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/envvars.rst | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/docs/envvars.rst b/docs/envvars.rst index fb563ceae8e..26186cc789b 100644 --- a/docs/envvars.rst +++ b/docs/envvars.rst @@ -207,7 +207,8 @@ Core Mesa environment variables cache implementation instead of the default multi-file cache implementation. This implementation reduces the overall disk usage by the shader cache and also allows for loading of precompiled cache - DBs via :envvar:`MESA_DISK_CACHE_READ_ONLY_FOZ_DBS`. This + DBs via :envvar:`MESA_DISK_CACHE_READ_ONLY_FOZ_DBS` or + :envvar:`MESA_DISK_CACHE_READ_ONLY_FOZ_DBS_DYNAMIC_LIST`. This implementation does not support cache size limits via :envvar:`MESA_SHADER_CACHE_MAX_SIZE`. If :envvar:`MESA_SHADER_CACHE_DIR` is not set, the cache will be stored @@ -223,7 +224,8 @@ Core Mesa environment variables relative to the cache directory and do not include suffixes, referencing both the cache DB and its index file. E.g. MESA_DISK_CACHE_SINGLE_FILE=filename1 refers to filename1.foz and - filename1_idx.foz. A limit of 8 DBs can be loaded. + filename1_idx.foz. A limit of 8 DBs can be loaded and this limit is + shared with :envvar:`MESA_DISK_CACHE_READ_ONLY_FOZ_DBS_DYNAMIC_LIST.` .. envvar:: MESA_DISK_CACHE_DATABASE @@ -237,6 +239,20 @@ Core Mesa environment variables or else within ``.cache/mesa_shader_cache_db`` within the user's home directory. +.. envvar:: MESA_DISK_CACHE_READ_ONLY_FOZ_DBS_DYNAMIC_LIST + + if set with :envvar:`MESA_DISK_CACHE_SINGLE_FILE` enabled, references + a text file that contains a new-line separated list of read only + Fossilize DB shader caches to load. The list file is modifiable at + runtime to allow for loading read only caches after initialization + unlike :envvar:`MESA_DISK_CACHE_READ_ONLY_FOZ_DBS`. This variable + takes an absolute path to the list file. The list file must exist at + initialization for updating to occur. Cache files in the list take + relative paths to the current cache directory like + :envvar:`MESA_DISK_CACHE_READ_ONLY_FOZ_DBS`. A limit of 8 DBs can be + loaded and this limit is shared with + :envvar:`MESA_DISK_CACHE_READ_ONLY_FOZ_DBS`. + .. envvar:: MESA_DISK_CACHE_COMBINE_RW_WITH_RO_FOZ if set to 1, enables simultaneous use of :abbr:`RW (read-write)` and |