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