]> git.baikalelectronics.ru Git - kernel.git/commit
bcache: introduce force_wake_up_gc()
authorColy Li <colyli@suse.de>
Thu, 13 Dec 2018 14:53:52 +0000 (22:53 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 13 Dec 2018 15:15:54 +0000 (08:15 -0700)
commit7076302d875288194a35ae65a4d57db02d105e5e
tree57601385261e5eb438c86454ebc7e88e373baec1
parent46056ecbb4cad43d1bceeaacb6c628763d576df7
bcache: introduce force_wake_up_gc()

Garbage collection thread starts to work when c->sectors_to_gc is
negative value, otherwise nothing will happen even the gc thread is
woken up by wake_up_gc().

force_wake_up_gc() sets c->sectors_to_gc to -1 before calling
wake_up_gc(), then gc thread may have chance to run if no one else sets
c->sectors_to_gc to a positive value before gc_should_run().

This routine can be called where the gc thread is woken up and required
to run in force.

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