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