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