blkcache.rst 1.5 KB

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