diff options
author | Jens Axboe <axboe@kernel.dk> | 2013-07-02 02:32:57 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2013-07-02 02:32:57 -0400 |
commit | d0e3d0238d83b05d7846c7281524e0f814633dbd (patch) | |
tree | 9b3750123faf4975bde744bb9da9219fb697e374 /Documentation | |
parent | 5f0e5afa0de4522abb3ea7d1369039b94e740ec5 (diff) | |
parent | 8e51e414a3c6d92ef2cc41720c67342a8e2c0bf7 (diff) |
Merge branch 'bcache-for-3.11' of git://evilpiepirate.org/~kent/linux-bcache into for-3.11/drivers
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/bcache.txt | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/Documentation/bcache.txt b/Documentation/bcache.txt index b3a7e7d384f6..32b6c3189d98 100644 --- a/Documentation/bcache.txt +++ b/Documentation/bcache.txt | |||
@@ -46,29 +46,33 @@ you format your backing devices and cache device at the same time, you won't | |||
46 | have to manually attach: | 46 | have to manually attach: |
47 | make-bcache -B /dev/sda /dev/sdb -C /dev/sdc | 47 | make-bcache -B /dev/sda /dev/sdb -C /dev/sdc |
48 | 48 | ||
49 | To make bcache devices known to the kernel, echo them to /sys/fs/bcache/register: | 49 | bcache-tools now ships udev rules, and bcache devices are known to the kernel |
50 | immediately. Without udev, you can manually register devices like this: | ||
50 | 51 | ||
51 | echo /dev/sdb > /sys/fs/bcache/register | 52 | echo /dev/sdb > /sys/fs/bcache/register |
52 | echo /dev/sdc > /sys/fs/bcache/register | 53 | echo /dev/sdc > /sys/fs/bcache/register |
53 | 54 | ||
54 | To register your bcache devices automatically, you could add something like | 55 | Registering the backing device makes the bcache device show up in /dev; you can |
55 | this to an init script: | 56 | now format it and use it as normal. But the first time using a new bcache |
57 | device, it'll be running in passthrough mode until you attach it to a cache. | ||
58 | See the section on attaching. | ||
56 | 59 | ||
57 | echo /dev/sd* > /sys/fs/bcache/register_quiet | 60 | The devices show up as: |
58 | 61 | ||
59 | It'll look for bcache superblocks and ignore everything that doesn't have one. | 62 | /dev/bcache<N> |
60 | 63 | ||
61 | Registering the backing device makes the bcache show up in /dev; you can now | 64 | As well as (with udev): |
62 | format it and use it as normal. But the first time using a new bcache device, | ||
63 | it'll be running in passthrough mode until you attach it to a cache. See the | ||
64 | section on attaching. | ||
65 | 65 | ||
66 | The devices show up at /dev/bcacheN, and can be controlled via sysfs from | 66 | /dev/bcache/by-uuid/<uuid> |
67 | /sys/block/bcacheN/bcache: | 67 | /dev/bcache/by-label/<label> |
68 | |||
69 | To get started: | ||
68 | 70 | ||
69 | mkfs.ext4 /dev/bcache0 | 71 | mkfs.ext4 /dev/bcache0 |
70 | mount /dev/bcache0 /mnt | 72 | mount /dev/bcache0 /mnt |
71 | 73 | ||
74 | You can control bcache devices through sysfs at /sys/block/bcache<N>/bcache . | ||
75 | |||
72 | Cache devices are managed as sets; multiple caches per set isn't supported yet | 76 | Cache devices are managed as sets; multiple caches per set isn't supported yet |
73 | but will allow for mirroring of metadata and dirty data in the future. Your new | 77 | but will allow for mirroring of metadata and dirty data in the future. Your new |
74 | cache set shows up as /sys/fs/bcache/<UUID> | 78 | cache set shows up as /sys/fs/bcache/<UUID> |
@@ -80,11 +84,11 @@ must be attached to your cache set to enable caching. Attaching a backing | |||
80 | device to a cache set is done thusly, with the UUID of the cache set in | 84 | device to a cache set is done thusly, with the UUID of the cache set in |
81 | /sys/fs/bcache: | 85 | /sys/fs/bcache: |
82 | 86 | ||
83 | echo <UUID> > /sys/block/bcache0/bcache/attach | 87 | echo <CSET-UUID> > /sys/block/bcache0/bcache/attach |
84 | 88 | ||
85 | This only has to be done once. The next time you reboot, just reregister all | 89 | This only has to be done once. The next time you reboot, just reregister all |
86 | your bcache devices. If a backing device has data in a cache somewhere, the | 90 | your bcache devices. If a backing device has data in a cache somewhere, the |
87 | /dev/bcache# device won't be created until the cache shows up - particularly | 91 | /dev/bcache<N> device won't be created until the cache shows up - particularly |
88 | important if you have writeback caching turned on. | 92 | important if you have writeback caching turned on. |
89 | 93 | ||
90 | If you're booting up and your cache device is gone and never coming back, you | 94 | If you're booting up and your cache device is gone and never coming back, you |
@@ -181,7 +185,7 @@ want for getting the best possible numbers when benchmarking. | |||
181 | 185 | ||
182 | In practice this isn't an issue because as soon as a write comes along it'll | 186 | In practice this isn't an issue because as soon as a write comes along it'll |
183 | cause the btree node to be split, and you need almost no write traffic for | 187 | cause the btree node to be split, and you need almost no write traffic for |
184 | this to not show up enough to be noticable (especially since bcache's btree | 188 | this to not show up enough to be noticeable (especially since bcache's btree |
185 | nodes are huge and index large regions of the device). But when you're | 189 | nodes are huge and index large regions of the device). But when you're |
186 | benchmarking, if you're trying to warm the cache by reading a bunch of data | 190 | benchmarking, if you're trying to warm the cache by reading a bunch of data |
187 | and there's no other traffic - that can be a problem. | 191 | and there's no other traffic - that can be a problem. |
@@ -191,6 +195,9 @@ want for getting the best possible numbers when benchmarking. | |||
191 | 195 | ||
192 | SYSFS - BACKING DEVICE: | 196 | SYSFS - BACKING DEVICE: |
193 | 197 | ||
198 | Available at /sys/block/<bdev>/bcache, /sys/block/bcache*/bcache and | ||
199 | (if attached) /sys/fs/bcache/<cset-uuid>/bdev* | ||
200 | |||
194 | attach | 201 | attach |
195 | Echo the UUID of a cache set to this file to enable caching. | 202 | Echo the UUID of a cache set to this file to enable caching. |
196 | 203 | ||
@@ -222,7 +229,7 @@ running | |||
222 | it's in passthrough mode or caching). | 229 | it's in passthrough mode or caching). |
223 | 230 | ||
224 | sequential_cutoff | 231 | sequential_cutoff |
225 | A sequential IO will bypass the cache once it passes this threshhold; the | 232 | A sequential IO will bypass the cache once it passes this threshold; the |
226 | most recent 128 IOs are tracked so sequential IO can be detected even when | 233 | most recent 128 IOs are tracked so sequential IO can be detected even when |
227 | it isn't all done at once. | 234 | it isn't all done at once. |
228 | 235 | ||
@@ -296,10 +303,12 @@ cache_miss_collisions | |||
296 | since the synchronization for cache misses was rewritten) | 303 | since the synchronization for cache misses was rewritten) |
297 | 304 | ||
298 | cache_readaheads | 305 | cache_readaheads |
299 | Count of times readahead occured. | 306 | Count of times readahead occurred. |
300 | 307 | ||
301 | SYSFS - CACHE SET: | 308 | SYSFS - CACHE SET: |
302 | 309 | ||
310 | Available at /sys/fs/bcache/<cset-uuid> | ||
311 | |||
303 | average_key_size | 312 | average_key_size |
304 | Average data per key in the btree. | 313 | Average data per key in the btree. |
305 | 314 | ||
@@ -362,7 +371,7 @@ unregister | |||
362 | SYSFS - CACHE SET INTERNAL: | 371 | SYSFS - CACHE SET INTERNAL: |
363 | 372 | ||
364 | This directory also exposes timings for a number of internal operations, with | 373 | This directory also exposes timings for a number of internal operations, with |
365 | separate files for average duration, average frequency, last occurence and max | 374 | separate files for average duration, average frequency, last occurrence and max |
366 | duration: garbage collection, btree read, btree node sorts and btree splits. | 375 | duration: garbage collection, btree read, btree node sorts and btree splits. |
367 | 376 | ||
368 | active_journal_entries | 377 | active_journal_entries |
@@ -390,6 +399,8 @@ trigger_gc | |||
390 | 399 | ||
391 | SYSFS - CACHE DEVICE: | 400 | SYSFS - CACHE DEVICE: |
392 | 401 | ||
402 | Available at /sys/block/<cdev>/bcache | ||
403 | |||
393 | block_size | 404 | block_size |
394 | Minimum granularity of writes - should match hardware sector size. | 405 | Minimum granularity of writes - should match hardware sector size. |
395 | 406 | ||
@@ -417,7 +428,7 @@ freelist_percent | |||
417 | space. | 428 | space. |
418 | 429 | ||
419 | io_errors | 430 | io_errors |
420 | Number of errors that have occured, decayed by io_error_halflife. | 431 | Number of errors that have occurred, decayed by io_error_halflife. |
421 | 432 | ||
422 | metadata_written | 433 | metadata_written |
423 | Sum of all non data writes (btree writes and all other metadata). | 434 | Sum of all non data writes (btree writes and all other metadata). |