Skip to content

Commit 309cc71

Browse files
Coly Liaxboe
authored andcommitted
bcache: Revert "bcache: shrink btree node cache after bch_btree_check()"
This reverts commit 1df3877. In my testing, sometimes even all the cached btree nodes are freed, creating gc and allocator kernel threads may still fail. Finally it turns out that kthread_run() may fail if there is pending signal for current task. And the pending signal is sent from OOM killer which is triggered by memory consuption in bch_btree_check(). Therefore explicitly shrinking bcache btree node here does not help, and after the shrinker callback is improved, as well as pending signals are ignored before creating kernel threads, now such operation is unncessary anymore. This patch reverts the commit 1df3877 ("bcache: shrink btree node cache after bch_btree_check()") because we have better improvement now. Signed-off-by: Coly Li <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 0b96da6 commit 309cc71

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

drivers/md/bcache/super.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1917,23 +1917,6 @@ static int run_cache_set(struct cache_set *c)
19171917
if (bch_btree_check(c))
19181918
goto err;
19191919

1920-
/*
1921-
* bch_btree_check() may occupy too much system memory which
1922-
* has negative effects to user space application (e.g. data
1923-
* base) performance. Shrink the mca cache memory proactively
1924-
* here to avoid competing memory with user space workloads..
1925-
*/
1926-
if (!c->shrinker_disabled) {
1927-
struct shrink_control sc;
1928-
1929-
sc.gfp_mask = GFP_KERNEL;
1930-
sc.nr_to_scan = c->btree_cache_used * c->btree_pages;
1931-
/* first run to clear b->accessed tag */
1932-
c->shrink.scan_objects(&c->shrink, &sc);
1933-
/* second run to reap non-accessed nodes */
1934-
c->shrink.scan_objects(&c->shrink, &sc);
1935-
}
1936-
19371920
bch_journal_mark(c, &journal);
19381921
bch_initial_gc_finish(c);
19391922
pr_debug("btree_check() done");

0 commit comments

Comments
 (0)