Heinrich Schuchardt | bb380b4 | 2023-01-15 11:35:55 +0100 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | .. Copyright 2023, Heinrich Schuchardt <heinrich.schuchardt@canonical.com> |
| 3 | |
| 4 | blkcache command |
| 5 | ================ |
| 6 | |
| 7 | Synopsis |
| 8 | -------- |
| 9 | |
| 10 | :: |
| 11 | |
| 12 | blkcache show |
| 13 | blkcache configure <blocks> <entries> |
| 14 | |
| 15 | Description |
| 16 | ----------- |
| 17 | |
| 18 | The *blkcache* command is used to control the size of the block cache and to |
| 19 | display statistics. |
| 20 | |
| 21 | The block cache buffers data read from block devices. This speeds up the access |
| 22 | to file-systems. |
| 23 | |
| 24 | show |
| 25 | show and reset statistics |
| 26 | |
| 27 | configure |
| 28 | set the maximum number of cache entries and the maximum number of blocks per |
| 29 | entry |
| 30 | |
| 31 | blocks |
| 32 | maximum number of blocks per cache entry. The block size is device specific. |
| 33 | The initial value is 8. |
| 34 | |
| 35 | entries |
| 36 | maximum number of entries in the cche. The initial value is 32. |
| 37 | |
| 38 | Example |
| 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 | |
| 65 | Configuration |
| 66 | ------------- |
| 67 | |
| 68 | The blkcache command is only available if CONFIG_CMD_BLOCK_CACHE=y. |
| 69 | |
| 70 | Return code |
| 71 | ----------- |
| 72 | |
| 73 | If the command succeeds, the return code $? is set 0 (true). In case of an |
| 74 | error the return code is set to 1 (false). |