blob: d3b2254cfadd1f6c04550a293854fc94314e0229 [file] [log] [blame]
Heinrich Schuchardt389be392023-01-15 11:35:55 +01001.. SPDX-License-Identifier: GPL-2.0+
2.. Copyright 2023, Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3
4blkcache command
5================
6
7Synopsis
8--------
9
10::
11
12 blkcache show
13 blkcache configure <blocks> <entries>
14
15Description
16-----------
17
18The *blkcache* command is used to control the size of the block cache and to
19display statistics.
20
21The block cache buffers data read from block devices. This speeds up the access
22to file-systems.
23
24show
25 show and reset statistics
26
27configure
28 set the maximum number of cache entries and the maximum number of blocks per
29 entry
30
31blocks
32 maximum number of blocks per cache entry. The block size is device specific.
33 The initial value is 8.
34
35entries
36 maximum number of entries in the cche. The initial value is 32.
37
38Example
39-------
40
41.. code-block::
42
43 => blkcache show
44 hits: 296
45 misses: 149
46 entries: 7
47 max blocks/entry: 8
48 max cache entries: 32
49 => blkcache show
50 hits: 0
51 misses: 0
52 entries: 7
53 max blocks/entry: 8
54 max cache entries: 32
55 => blkcache configure 16 64
56 changed to max of 64 entries of 16 blocks each
57 => blkcache show
58 hits: 0
59 misses: 0
60 entries: 0
61 max blocks/entry: 16
62 max cache entries: 64
63 =>
64
65Configuration
66-------------
67
68The blkcache command is only available if CONFIG_CMD_BLOCK_CACHE=y.
69
70Return code
71-----------
72
73If the command succeeds, the return code $? is set 0 (true). In case of an
74error the return code is set to 1 (false).