Lines Matching refs:bucket

42  * To do this, we first divide the cache device up into buckets. A bucket is the
46 * Each bucket has a 16 bit priority, and an 8 bit generation associated with
51 * The priority is used to implement an LRU. We reset a bucket's priority when
53 * of each bucket. It could be used to implement something more sophisticated,
58 * must match the gen of the bucket it points into. Thus, to reuse a bucket all
62 * Bcache is entirely COW - we never write twice to a bucket, even buckets that
100 * accomplished by either by invalidating pointers (by incrementing a bucket's
110 * Our unit of allocation is a bucket, and we we can't arbitrarily allocate and
111 * free smaller than a bucket - so, that's how big our btree nodes are.
113 * (If buckets are really big we'll only use part of the bucket for a btree node
114 * - no less than 1/4th - but a bucket still contains no more than a single
116 * bucket's gen for deleting btree nodes when we rewrite/split a node.)
139 * We can't just invalidate any bucket - it might contain dirty data or
141 * later, leaving no valid pointers into that bucket in the index.
144 * It also counts how much valid data it each bucket currently contains, so that
149 * some threshold, it rewrites the btree node to avoid the bucket's generation
197 struct bucket {
207 * as multiple threads touch struct bucket without locking
210 BITMASK(GC_MARK, struct bucket, gc_mark, 0, 2);
216 BITMASK(GC_SECTORS_USED, struct bucket, gc_mark, 2, GC_SECTORS_USED_SIZE);
217 BITMASK(GC_MOVE, struct bucket, gc_mark, 15, 1);
448 struct bucket *buckets;
450 DECLARE_HEAP(struct bucket *, heap);
552 * full bucket
590 * When we free a btree node, we increment the gen of the bucket the
604 * rescale; when it hits 0 we rescale all the bucket priorities.
615 * priority of any bucket.
647 * The allocation code needs gc_mark in struct bucket to be correct, but
818 static inline struct bucket *PTR_BUCKET(struct cache_set *c,
910 * bucket_gc_gen() returns the difference between the bucket's current gen and
911 * the oldest gen of any pointer into that bucket in the btree (last_gc).
914 static inline uint8_t bucket_gc_gen(struct bucket *b)
978 uint8_t bch_inc_gen(struct cache *ca, struct bucket *b);
981 bool bch_can_invalidate_bucket(struct cache *ca, struct bucket *b);
982 void __bch_invalidate_one_bucket(struct cache *ca, struct bucket *b);
984 void __bch_bucket_free(struct cache *ca, struct bucket *b);