]> git.baikalelectronics.ru Git - kernel.git/commit
bcache: option to automatically run gc thread after writeback
authorColy Li <colyli@suse.de>
Thu, 13 Dec 2018 14:53:53 +0000 (22:53 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 13 Dec 2018 15:15:54 +0000 (08:15 -0700)
commit440df07b9533ad4ff6b373da3c3d12fc09334519
treea4199a4a11b9fff8b6e02d7e6dad331991c091a9
parent7076302d875288194a35ae65a4d57db02d105e5e
bcache: option to automatically run gc thread after writeback

The option gc_after_writeback is disabled by default, because garbage
collection will discard SSD data which drops cached data.

Echo 1 into /sys/fs/bcache/<UUID>/internal/gc_after_writeback will
enable this option, which wakes up gc thread when writeback accomplished
and all cached data is clean.

This option is helpful for people who cares writing performance more. In
heavy writing workload, all cached data can be clean only happens when
writeback thread cleans all cached data in I/O idle time. In such
situation a following gc running may help to shrink bcache B+ tree and
discard more clean data, which may be helpful for future writing
requests.

If you are not sure whether this is helpful for your own workload,
please leave it as disabled by default.

Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/bcache.h
drivers/md/bcache/sysfs.c
drivers/md/bcache/writeback.c
drivers/md/bcache/writeback.h