• Coly Li's avatar
    bcache: reap from tail of c->btree_cache in bch_mca_scan() · e3de0446
    Coly Li authored
    When shrink btree node cache from c->btree_cache in bch_mca_scan(),
    no matter the selected node is reaped or not, it will be rotated from
    the head to the tail of c->btree_cache list. But in bcache journal
    code, when flushing the btree nodes with oldest journal entry, btree
    nodes are iterated and slected from the tail of c->btree_cache list in
    btree_flush_write(). The list_rotate_left() in bch_mca_scan() will
    make btree_flush_write() iterate more nodes in c->btree_list in reverse
    order.
    
    This patch just reaps the selected btree node cache, and not move it
    from the head to the tail of c->btree_cache list. Then bch_mca_scan()
    will not mess up c->btree_cache list to btree_flush_write().
    Signed-off-by: default avatarColy Li <colyli@suse.de>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    e3de0446
btree.c 60.5 KB