diff options
-rw-r--r-- | drivers/md/bcache/alloc.c | 15 | ||||
-rw-r--r-- | drivers/md/bcache/bcache.h | 3 | ||||
-rw-r--r-- | include/trace/events/bcache.h | 18 |
3 files changed, 13 insertions, 23 deletions
diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c index 165fb8d36db2..6209e42c5633 100644 --- a/drivers/md/bcache/alloc.c +++ b/drivers/md/bcache/alloc.c @@ -818,18 +818,13 @@ void bch_open_bucket_put(struct cache_set *c, struct open_bucket *b) } static struct open_bucket *bch_open_bucket_get(struct cache_set *c, - bool moving_gc, struct closure *cl) { struct open_bucket *ret; - unsigned reserve = 0; - - if (!moving_gc) - reserve = OPEN_BUCKETS_MOVING_GC_RESERVE * c->sb.nr_in_set; spin_lock(&c->open_buckets_lock); - if (c->open_buckets_nr_free > reserve) { + if (c->open_buckets_nr_free) { BUG_ON(list_empty(&c->open_buckets_free)); ret = list_first_entry(&c->open_buckets_free, struct open_bucket, list); @@ -838,9 +833,9 @@ static struct open_bucket *bch_open_bucket_get(struct cache_set *c, ret->sectors_free = c->sb.bucket_size; bkey_init(&ret->key); c->open_buckets_nr_free--; - trace_bcache_open_bucket_alloc(c, moving_gc, cl); + trace_bcache_open_bucket_alloc(c, cl); } else { - trace_bcache_open_bucket_alloc_fail(c, moving_gc, cl); + trace_bcache_open_bucket_alloc_fail(c, cl); if (cl) { closure_wait(&c->open_buckets_wait, cl); @@ -862,7 +857,7 @@ static struct open_bucket *bch_open_bucket_alloc(struct cache_set *c, int ret; struct open_bucket *b; - b = bch_open_bucket_get(c, false, cl); + b = bch_open_bucket_get(c, cl); if (IS_ERR_OR_NULL(b)) return b; @@ -1100,7 +1095,7 @@ found: if (!b) { mutex_unlock(&c->bucket_lock); - b = bch_open_bucket_get(c, true, NULL); + b = bch_open_bucket_get(c, NULL); if (WARN_ONCE(IS_ERR(b), "bcache: movinggc bucket allocation failed with %ld", PTR_ERR(b))) { diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h index c6459e59ca7e..03e316d51b76 100644 --- a/drivers/md/bcache/bcache.h +++ b/drivers/md/bcache/bcache.h @@ -481,9 +481,6 @@ enum alloc_reserve { /* Enough for 16 cache devices, 2 tiers and some left over for pipelining */ #define OPEN_BUCKETS_COUNT 256 -/* We don't want open bucket allocations from bch_alloc_gc_sectors() to fail */ -#define OPEN_BUCKETS_MOVING_GC_RESERVE NUM_GC_GENS - struct open_bucket { struct list_head list; atomic_t pin; diff --git a/include/trace/events/bcache.h b/include/trace/events/bcache.h index 3f92826ec5f9..917d721cca3f 100644 --- a/include/trace/events/bcache.h +++ b/include/trace/events/bcache.h @@ -848,33 +848,31 @@ TRACE_EVENT(bcache_bucket_alloc_set_fail, ); DECLARE_EVENT_CLASS(open_bucket_alloc, - TP_PROTO(struct cache_set *c, bool moving_gc, struct closure *cl), - TP_ARGS(c, moving_gc, cl), + TP_PROTO(struct cache_set *c, struct closure *cl), + TP_ARGS(c, cl), TP_STRUCT__entry( __array(char, uuid, 16 ) - __field(unsigned, moving_gc ) __field(struct closure *, cl ) ), TP_fast_assign( memcpy(__entry->uuid, c->sb.set_uuid.b, 16); - __entry->moving_gc = moving_gc; __entry->cl = cl; ), - TP_printk("%pU moving_gc %u cl %p", - __entry->uuid, __entry->moving_gc, __entry->cl) + TP_printk("%pU cl %p", + __entry->uuid, __entry->cl) ); DEFINE_EVENT(open_bucket_alloc, bcache_open_bucket_alloc, - TP_PROTO(struct cache_set *c, bool moving_gc, struct closure *cl), - TP_ARGS(c, moving_gc, cl) + TP_PROTO(struct cache_set *c, struct closure *cl), + TP_ARGS(c, cl) ); DEFINE_EVENT(open_bucket_alloc, bcache_open_bucket_alloc_fail, - TP_PROTO(struct cache_set *c, bool moving_gc, struct closure *cl), - TP_ARGS(c, moving_gc, cl) + TP_PROTO(struct cache_set *c, struct closure *cl), + TP_ARGS(c, cl) ); /* Copy GC */ |