• Tang Junhui's avatar
    bcache: calculate the number of incremental GC nodes according to the total of btree nodes · 7f4a59de
    Tang Junhui authored
    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: default avatarTang Junhui <tang.junhui@zte.com.cn>
    Signed-off-by: default avatarColy Li <colyli@suse.de>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    7f4a59de
btree.c 58.6 KB