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