aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/movinggc.c
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-12-17 01:29:34 -0800
committerKent Overstreet <kmo@daterainc.com>2014-01-08 13:05:09 -0800
commit78365411b344df35a198b119133e6515c2dcfb9f (patch)
treee94c2e1bd0d5dc53e6a938b012e9b20d3a511eca /drivers/md/bcache/movinggc.c
parentbcache: kill closure locking code (diff)
downloadlinux-dev-78365411b344df35a198b119133e6515c2dcfb9f.tar.xz
linux-dev-78365411b344df35a198b119133e6515c2dcfb9f.zip
bcache: Rework allocator reserves
We need a reserve for allocating buckets for new btree nodes - and now that we've got multiple btrees, it really needs to be per btree. This reworks the reserves so we've got separate freelists for each reserve instead of watermarks, which seems to make things a bit cleaner, and it adds some code so that btree_split() can make sure the reserve is available before it starts. Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/movinggc.c')
-rw-r--r--drivers/md/bcache/movinggc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/bcache/movinggc.c b/drivers/md/bcache/movinggc.c
index 052bd24d24b4..9eb60d102de8 100644
--- a/drivers/md/bcache/movinggc.c
+++ b/drivers/md/bcache/movinggc.c
@@ -211,7 +211,7 @@ void bch_moving_gc(struct cache_set *c)
for_each_cache(ca, c, i) {
unsigned sectors_to_move = 0;
unsigned reserve_sectors = ca->sb.bucket_size *
- min(fifo_used(&ca->free), ca->free.size / 2);
+ fifo_used(&ca->free[RESERVE_MOVINGGC]);
ca->heap.used = 0;