Lines Matching +full:d +full:- +full:cache +full:- +full:size
1 .. SPDX-License-Identifier: GPL-2.0
10 This facility is a general purpose cache for network filesystems, though it
13 FS-Cache mediates between cache backends (such as CacheFiles) and network
16 +---------+
17 | | +--------------+
18 | NFS |--+ | |
19 | | | +-->| CacheFS |
20 +---------+ | +----------+ | | /dev/hda5 |
21 | | | | +--------------+
22 +---------+ +-------------->| | |
23 | | +-------+ | |--+
24 | AFS |----->| | | FS-Cache |
25 | | | netfs |-->| |--+
26 +---------+ +-->| lib | | | |
27 | | | | | | +--------------+
28 +---------+ | +-------+ +----------+ | | |
29 | | | +-->| CacheFiles |
30 | 9P |--+ | /var/cache |
31 | | +--------------+
32 +---------+
34 Or to look at it another way, FS-Cache is a module that provides a caching
35 facility to a network filesystem such that the cache is transparent to the
38 +---------+
42 +---------+
46 | +----------+
48 +---------+ | |
50 | NFS |----->| FS-Cache |
51 | | | |--+
52 +---------+ | | | +--------------+ +--------------+
54 V +----------+ +-->| CacheFiles |-->| Ext3 |
55 +---------+ | /var/cache | | /dev/sda6 |
56 | | +--------------+ +--------------+
59 +---------+ +--------------+ |
64 +---------+ +--------------+
68 +---------+ +--------------+
71 FS-Cache does not follow the idea of completely loading every netfs file
72 opened in its entirety into a cache before permitting it to be accessed and
73 then serving the pages out of that cache rather than the netfs inode because:
75 (1) It must be practical to operate without a cache.
77 (2) The size of any accessible file must not be limited to the size of the
78 cache.
80 (3) The combined size of all opened files (this includes mapped libraries)
81 must not be limited to the size of the cache.
84 one-off access of a small portion of it (such as might be done with the
87 It instead serves the cache out in chunks as and when requested by the netfs
91 FS-Cache provides the following facilities:
93 * More than one cache can be used at once. Caches can be selected
104 * There are three types of cookie: cache, volume and data file cookies.
105 Cache cookies represent the cache as a whole and are not normally visible
108 data file cookies are used to cache data (something that would be got for
122 * Cookie resources are set up and pinned by marking the cookie in-use.
128 A cookie can be marked in-use multiple times simultaneously; each mark
131 * Begin/end access functions are provided to delay cache withdrawal for the
138 * An invalidation facility is available to discard data from the cache and
142 removed from the cache.
145 The netfs API to FS-Cache can be found in:
147 Documentation/filesystems/caching/netfs-api.rst
149 The cache backend API to FS-Cache can be found in:
151 Documentation/filesystems/caching/backend-api.rst
157 If FS-Cache is compiled with the following options enabled::
165 This shows counts of a number of events that can happen in FS-Cache:
167 +--------------+-------+-------------------------------------------------------+
171 + +-------+-------------------------------------------------------+
173 + +-------+-------------------------------------------------------+
175 + +-------+-------------------------------------------------------+
177 +--------------+-------+-------------------------------------------------------+
179 + +-------+-------------------------------------------------------+
181 + +-------+-------------------------------------------------------+
183 +--------------+-------+-------------------------------------------------------+
185 + +-------+-------------------------------------------------------+
187 + +-------+-------------------------------------------------------+
189 + +-------+-------------------------------------------------------+
190 | |drp=N |Number of LRU'd cookies relinquished/withdrawn |
191 + +-------+-------------------------------------------------------+
193 +--------------+-------+-------------------------------------------------------+
195 +--------------+-------+-------------------------------------------------------+
197 + +-------+-------------------------------------------------------+
199 + +-------+-------------------------------------------------------+
201 +--------------+-------+-------------------------------------------------------+
203 + +-------+-------------------------------------------------------+
205 + +-------+-------------------------------------------------------+
206 | |drop=N |Number of cookies no longer blocking re-acquisition |
207 +--------------+-------+-------------------------------------------------------+
209 + +-------+-------------------------------------------------------+
211 + +-------+-------------------------------------------------------+
213 +--------------+-------+-------------------------------------------------------+
214 |IO |rd=N |Number of read operations in the cache |
215 + +-------+-------------------------------------------------------+
216 | |wr=N |Number of write operations in the cache |
217 +--------------+-------+-------------------------------------------------------+
222 Cache List
225 FS-Cache provides a list of cache cookies:
232 CACHE REF VOLS OBJS ACCES S NAME
241 CACHE Cache cookie debug ID (also appears in traces)
242 REF Number of references on the cache cookie
243 VOLS Number of volumes cookies in this cache
244 OBJS Number of cache objects in use
245 ACCES Number of accesses pinning the cache
247 NAME Name of the cache.
250 The state can be (-) Inactive, (P)reparing, (A)ctive, (E)rror or (W)ithdrawing.
256 FS-Cache provides a list of volume cookies:
262 VOLUME REF nCOOK ACC FL CACHE KEY
274 ACC Number of accesses pinning the cache
276 CACHE Name of the cache or "-"
284 FS-Cache provides a list of cookies:
293 00000435 00000001 1 0 -1 - 08 0000000201d080070000000000000000, 0000000000000000
294 00000436 00000001 1 0 -1 - 00 0000005601d080080000000000000000, 0000000000000051
295 00000437 00000001 1 0 -1 - 08 00023b3001d0823f0000000000000000, 0000000000000000
296 00000438 00000001 1 0 -1 - 08 0000005801d0807b0000000000000000, 0000000000000000
297 00000439 00000001 1 0 -1 - 08 00023b3201d080a10000000000000000, 0000000000000000
298 0000043a 00000001 1 0 -1 - 08 00023b3401d080a30000000000000000, 0000000000000000
299 0000043b 00000001 1 0 -1 - 08 00023b3601d080b30000000000000000, 0000000000000000
300 0000043c 00000001 1 0 -1 - 08 00023b3801d080b40000000000000000, 0000000000000000
321 If CONFIG_NETFS_DEBUG is enabled, the FS-Cache facility and NETFS support can
331 0 1 Cache management Function entry trace
337 6-8 (Not used)
343 The appropriate set of values should be OR'd together and the result written to