• Coly Li's avatar
    bcache: shrink btree node cache after bch_btree_check() · 1df3877f
    Coly Li authored
    When cache set starts, bch_btree_check() will check all bkeys on cache
    device by calculating the checksum. This operation will consume a huge
    number of system memory if there are a lot of data cached. Since bcache
    uses its own mca cache to maintain all its read-in btree nodes, and only
    releases the cache space when system memory manage code starts to shrink
    caches. Then before memory manager code to call the mca cache shrinker
    callback, bcache mca cache will compete memory resource with user space
    application, which may have nagive effect to performance of user space
    workloads (e.g. data base, or I/O service of distributed storage node).
    
    This patch tries to call bcache mca shrinker routine to proactively
    release mca cache memory, to decrease the memory pressure of system and
    avoid negative effort of the overall system I/O performance.
    Signed-off-by: default avatarColy Li <colyli@suse.de>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    1df3877f
super.c 65.8 KB