1 What: /sys/block/<disk>/bcache/unregister
3 Contact: Kent Overstreet <kent.overstreet@gmail.com>
5 A write to this file causes the backing device or cache to be
6 unregistered. If a backing device had dirty data in the cache,
7 writeback mode is automatically disabled and all dirty data is
8 flushed before the device is unregistered. Caches unregister
9 all associated backing devices before unregistering themselves.
11 What: /sys/block/<disk>/bcache/clear_stats
13 Contact: Kent Overstreet <kent.overstreet@gmail.com>
15 Writing to this file resets all the statistics for the device.
17 What: /sys/block/<disk>/bcache/cache
19 Contact: Kent Overstreet <kent.overstreet@gmail.com>
21 For a backing device that has cache, a symlink to
22 the bcache/ dir of that cache.
24 What: /sys/block/<disk>/bcache/cache_hits
26 Contact: Kent Overstreet <kent.overstreet@gmail.com>
28 For backing devices: integer number of full cache hits,
29 counted per bio. A partial cache hit counts as a miss.
31 What: /sys/block/<disk>/bcache/cache_misses
33 Contact: Kent Overstreet <kent.overstreet@gmail.com>
35 For backing devices: integer number of cache misses.
37 What: /sys/block/<disk>/bcache/cache_hit_ratio
39 Contact: Kent Overstreet <kent.overstreet@gmail.com>
41 For backing devices: cache hits as a percentage.
43 What: /sys/block/<disk>/bcache/sequential_cutoff
45 Contact: Kent Overstreet <kent.overstreet@gmail.com>
47 For backing devices: Threshold past which sequential IO will
48 skip the cache. Read and written as bytes in human readable
49 units (i.e. echo 10M > sequntial_cutoff).
51 What: /sys/block/<disk>/bcache/bypassed
53 Contact: Kent Overstreet <kent.overstreet@gmail.com>
55 Sum of all reads and writes that have bypassed the cache (due
56 to the sequential cutoff). Expressed as bytes in human
59 What: /sys/block/<disk>/bcache/writeback
61 Contact: Kent Overstreet <kent.overstreet@gmail.com>
63 For backing devices: When on, writeback caching is enabled and
64 writes will be buffered in the cache. When off, caching is in
65 writethrough mode; reads and writes will be added to the
66 cache but no write buffering will take place.
68 What: /sys/block/<disk>/bcache/writeback_running
70 Contact: Kent Overstreet <kent.overstreet@gmail.com>
72 For backing devices: when off, dirty data will not be written
73 from the cache to the backing device. The cache will still be
74 used to buffer writes until it is mostly full, at which point
75 writes transparently revert to writethrough mode. Intended only
76 for benchmarking/testing.
78 What: /sys/block/<disk>/bcache/writeback_delay
80 Contact: Kent Overstreet <kent.overstreet@gmail.com>
82 For backing devices: In writeback mode, when dirty data is
83 written to the cache and the cache held no dirty data for that
84 backing device, writeback from cache to backing device starts
85 after this delay, expressed as an integer number of seconds.
87 What: /sys/block/<disk>/bcache/writeback_percent
89 Contact: Kent Overstreet <kent.overstreet@gmail.com>
91 For backing devices: If nonzero, writeback from cache to
92 backing device only takes place when more than this percentage
93 of the cache is used, allowing more write coalescing to take
94 place and reducing total number of writes sent to the backing
95 device. Integer between 0 and 40.
97 What: /sys/block/<disk>/bcache/synchronous
99 Contact: Kent Overstreet <kent.overstreet@gmail.com>
101 For a cache, a boolean that allows synchronous mode to be
102 switched on and off. In synchronous mode all writes are ordered
103 such that the cache can reliably recover from unclean shutdown;
104 if disabled bcache will not generally wait for writes to
105 complete but if the cache is not shut down cleanly all data
106 will be discarded from the cache. Should not be turned off with
107 writeback caching enabled.
109 What: /sys/block/<disk>/bcache/discard
111 Contact: Kent Overstreet <kent.overstreet@gmail.com>
113 For a cache, a boolean allowing discard/TRIM to be turned off
114 or back on if the device supports it.
116 What: /sys/block/<disk>/bcache/bucket_size
118 Contact: Kent Overstreet <kent.overstreet@gmail.com>
120 For a cache, bucket size in human readable units, as set at
121 cache creation time; should match the erase block size of the
122 SSD for optimal performance.
124 What: /sys/block/<disk>/bcache/nbuckets
126 Contact: Kent Overstreet <kent.overstreet@gmail.com>
128 For a cache, the number of usable buckets.
130 What: /sys/block/<disk>/bcache/tree_depth
132 Contact: Kent Overstreet <kent.overstreet@gmail.com>
134 For a cache, height of the btree excluding leaf nodes (i.e. a
135 one node tree will have a depth of 0).
137 What: /sys/block/<disk>/bcache/btree_cache_size
139 Contact: Kent Overstreet <kent.overstreet@gmail.com>
141 Number of btree buckets/nodes that are currently cached in
142 memory; cache dynamically grows and shrinks in response to
143 memory pressure from the rest of the system.
145 What: /sys/block/<disk>/bcache/written
147 Contact: Kent Overstreet <kent.overstreet@gmail.com>
149 For a cache, total amount of data in human readable units
150 written to the cache, excluding all metadata.
152 What: /sys/block/<disk>/bcache/btree_written
154 Contact: Kent Overstreet <kent.overstreet@gmail.com>
156 For a cache, sum of all btree writes in human readable units.