From: Tang Junhui <tang.junhui@xxxxxxxxxx> We make a lot of effort to sort buckets in heap, but we only pull half of buckets into free_inc queue, it's too wasteful. And in incremental GC, we may run out of all buckets in free_inc queue during GC, so it would be useful if we have more buckets in free_inc queue. This patch enlarge the size of free_inc queue as much as the heap. Signed-off-by: Tang Junhui <tang.junhui@xxxxxxxxxx> --- drivers/md/bcache/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index b4d2892..6f428c0 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1835,7 +1835,7 @@ static int cache_alloc(struct cache *ca) !init_fifo_exact(&ca->free[RESERVE_PRIO], prio_buckets(ca), GFP_KERNEL) || !init_fifo(&ca->free[RESERVE_MOVINGGC], free, GFP_KERNEL) || !init_fifo(&ca->free[RESERVE_NONE], free, GFP_KERNEL) || - !init_fifo(&ca->free_inc, free << 2, GFP_KERNEL) || + !init_fifo(&ca->free_inc, free << 3, GFP_KERNEL) || !init_heap(&ca->heap, free << 3, GFP_KERNEL) || !(ca->buckets = vzalloc(sizeof(struct bucket) * ca->sb.nbuckets)) || -- 1.8.3.1