Lines Matching full: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 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 { struct
208 * as multiple threads touch struct bucket without locking argument
211 BITMASK(GC_MARK, struct bucket, gc_mark, 0, 2);
217 BITMASK(GC_SECTORS_USED, struct bucket, gc_mark, 2, GC_SECTORS_USED_SIZE);
218 BITMASK(GC_MOVE, struct bucket, gc_mark, 15, 1);
459 struct bucket *buckets;
461 DEFINE_MIN_HEAP(struct bucket *, cache_heap) heap;
561 * full bucket
599 * When we free a btree node, we increment the gen of the bucket the
613 * rescale; when it hits 0 we rescale all the bucket priorities.
624 * priority of any bucket.
656 * The allocation code needs gc_mark in struct bucket to be correct, but
820 static inline struct bucket *PTR_BUCKET(struct cache_set *c, in PTR_BUCKET()
912 * bucket_gc_gen() returns the difference between the bucket's current gen and
913 * the oldest gen of any pointer into that bucket in the btree (last_gc).
916 static inline uint8_t bucket_gc_gen(struct bucket *b) in bucket_gc_gen()
980 uint8_t bch_inc_gen(struct cache *ca, struct bucket *b);
983 bool bch_can_invalidate_bucket(struct cache *ca, struct bucket *b);
984 void __bch_invalidate_one_bucket(struct cache *ca, struct bucket *b);
986 void __bch_bucket_free(struct cache *ca, struct bucket *b);