]> git.baikalelectronics.ru Git - kernel.git/commit
bcache: calculate the number of incremental GC nodes according to the total of btree...
authorTang Junhui <tang.junhui@zte.com.cn>
Thu, 26 Jul 2018 04:17:35 +0000 (12:17 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 27 Jul 2018 15:15:46 +0000 (09:15 -0600)
commit6062dd0a7d1c916199adb337402dfa66af00560b
treedfb79852a9a9a16f766b5a3f31240b467d484dfc
parent3fa927bd14a97958eb104ef15bd00584a2861a74
bcache: calculate the number of incremental GC nodes according to the total of btree nodes

This patch base on "[PATCH] bcache: finish incremental GC".

Since incremental GC would stop 100ms when front side I/O comes, so when
there are many btree nodes, if GC only processes constant (100) nodes each
time, GC would last a long time, and the front I/Os would run out of the
buckets (since no new bucket can be allocated during GC), and I/Os be
blocked again.

So GC should not process constant nodes, but varied nodes according to the
number of btree nodes. In this patch, GC is divided into constant (100)
times, so when there are many btree nodes, GC can process more nodes each
time, otherwise GC will process less nodes each time (but no less than
MIN_GC_NODES).

Signed-off-by: Tang Junhui <tang.junhui@zte.com.cn>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/btree.c