[Bcache v13 00/16]
Subsystems (17)
Tejun Heo
maintainerRe: [Bcache v13 14/16] bcache: Request, io and allocation code
In reply to Kent OverstreetHello, Kent.
I followed the control from cached_dev_make_request() this time.
Quoted 2 lines · Kent Overstreet
+ * Since the gens and priorities are all stored contiguously on disk, we can
+ * batch this up: We fill up thefree_inclist with freshly invalidated buckets,
What does "inc" in free_inc stand for?
Quoted 6 lines
drivers/block/bcache/alloc.c new file +6
-0+static void discard_finish (struct work_struct *w) +{ + struct discard *d = container_of(w, struct discard, work); +struct cache *c = d->c; +char buf[BDEVNAME_SIZE ]; +bool run = false;
drivers/block/bcache/alloc.c line 159
Quoted 10 lines
drivers/block/bcache/alloc.c new file +10
-0+ +if (!test_bit (BIO_UPTODATE , &d->bio.bi_flags)) { +printk (KERN_NOTICE "bcache: discard error on %s, disabling\n" , +bdevname (c->bdev, buf)); + d->c->discard =0 ; + } + +mutex_lock (&c->set->bucket_lock); +if (fifo_empty (&c->free) || +fifo_used (&c->free) ==8 )
I'm getting scared of the number 8. What does this mean? Is it the new 666? Oh, now I think about it, it's 2^3 thus 2*2*2. It's 3 of 2s. I think I can see the connection now. Oh devil!
drivers/block/bcache/alloc.c line 166
Quoted 7 lines
drivers/block/bcache/alloc.c new file +7
-0+ run = true; + +fifo_push (&c->free, d->bucket); + +list_add (&d->list, &c->discards); + +do_discard (c);
So, this chains discard issuing. Wouldn't some explanation be nice?
Quoted 5 lines
drivers/block/bcache/alloc.c new file +5
-0+mutex_unlock (&c->set->bucket_lock); + +if (run) +closure_wake_up (&c->set->bucket_wait); +
drivers/block/bcache/alloc.c line 181
Quoted 10 lines
drivers/block/bcache/alloc.c new file +10
-0+closure_put (&c->set->cl); +} + +static void discard_endio (struct bio *bio,int error) +{ + struct discard *d = container_of(bio, struct discard, bio); + +PREPARE_WORK (&d->work, discard_finish); +schedule_work (&d->work); +}
Why is a work item used here? Why not closure? What's the difference? This pattern of bouncing completion processing to process context is also something common in bio sequencing. I keep thinking what we want is bio sequencer.
drivers/block/bcache/alloc.c line 193
Quoted 12 lines
drivers/block/bcache/alloc.c new file +12
-0+ +static void discard_work (struct work_struct *w) +{ + struct discard *d = container_of(w, struct discard, work); +submit_bio (0 , &d->bio); +} + +static void do_discard (struct cache *c) +{ +struct request_queue *q =bdev_get_queue (c->bdev); +int s = q->limits.logical_block_size; +
Prolly can use lockdep_assert_held().
drivers/block/bcache/alloc.c line 197
Quoted 4 lines
drivers/block/bcache/alloc.c new file +4
-0+while (c->discard && + !atomic_read (&c->set->closing) && + !list_empty (&c->discards) && +fifo_free (&c->free) >=8 ) {
What's the magic 8? Is this 8 someway related to other 8s in this file? How is one supposed to know what they mean or the rationale behind it?
Quoted 34 lines
drivers/block/bcache/alloc.c new file +34
-0+struct discard *d =list_first_entry (&c->discards, + struct discard, list); + + d->bucket =pop_freed (c); +if (d->bucket ==-1 ) +break ; + +list_del (&d->list); +closure_get (&c->set->cl); + +bio_init (&d->bio); +memset (&d->bv,0 ,sizeof (struct bio_vec )); +bio_set_prio (&d->bio,IOPRIO_PRIO_VALUE (IOPRIO_CLASS_IDLE ,0 )); + + d->bio.bi_sector =bucket_to_sector (c->set, d->bucket); + d->bio.bi_bdev = c->bdev; + d->bio.bi_rw =REQ_WRITE |(1 <<BIO_RW_DISCARD ); + d->bio.bi_max_vecs =1 ; + d->bio.bi_io_vec = d->bio.bi_inline_vecs; + d->bio.bi_end_io = discard_endio; + +if (bio_add_pc_page (q, &d->bio, c->discard_page, s,0 ) < s) { +printk (KERN_DEBUG "bcache: bio_add_pc_page failed\n" ); + c->discard =0 ; +fifo_push (&c->free, d->bucket); +list_add (&d->list, &c->discards); +break ; + } + + d->bio.bi_size =bucket_bytes (c); + +schedule_work (&d->work); + } +}
...
Quoted 4 lines
drivers/block/bcache/alloc.c new file +4
-0+int alloc_discards (struct cache *ca) +{ +for (int i =0 ; i <8 ; i++) { +struct discard *d =kzalloc (sizeof (*d),GFP_KERNEL );
drivers/block/bcache/alloc.c line 258
Quoted 10 lines
drivers/block/bcache/alloc.c new file +10
-0+if (!d) +return -ENOMEM ; + + d->c = ca; +INIT_WORK (&d->work, discard_work); +list_add (&d->list, &ca->discards); + } + +return 0 ; +}
Why maintain separate pool of discards? It it to throttle discard commands? And another evil number!
drivers/block/bcache/alloc.c line 285
Quoted 6 lines
drivers/block/bcache/alloc.c new file +6
-0+static bool can_invalidate_bucket (struct cache *c,struct bucket *b) +{ +return b->mark >=0 && + !atomic_read (&b->pin) && +bucket_gc_gen (b) <96U && +bucket_disk_gen (b) <64U ;
Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
Quoted 12 lines
drivers/block/bcache/alloc.c new file +12
-0+static void invalidate_buckets_lru (struct cache *c) +{ +unsigned bucket_prio (struct bucket *b) + { +return ((unsigned ) (b->prio - c->set->min_prio)) * b->mark; + } + +bool bucket_max_cmp (struct bucket *l,struct bucket *r) + { +return bucket_prio (l) <bucket_prio (r); + } +
drivers/block/bcache/alloc.c line 317
Quoted 10 lines
drivers/block/bcache/alloc.c new file +10
-0+bool bucket_min_cmp (struct bucket *l,struct bucket *r) + { +return bucket_prio (l) >bucket_prio (r); + } + +struct bucket *b; + + c->heap.used =0 ; + +for_each_bucket (b, c) {
So, this iterates all buckets in the cache, right? Maybe it warrants cond_resched()?
Quoted 38 lines
drivers/block/bcache/alloc.c new file +38
-0+if (!can_invalidate_bucket (c, b)) +continue ; + +if (!b->mark) { +if (!bucket_add_unused (c, b)) +return ; + }else { +if (!heap_full (&c->heap)) +heap_add (&c->heap, b, bucket_max_cmp); +else if (bucket_max_cmp (b,heap_peek (&c->heap))) { + c->heap.data[0 ] = b; +heap_sift (&c->heap,0 , bucket_max_cmp); + } + } + } + +if (c->heap.used *2 < c->heap.size) +bcache_queue_gc (c->set); + +for (ssize_t i = c->heap.used /2 -1 ; i >=0 ; --i) +heap_sift (&c->heap, i, bucket_min_cmp); + +while (!fifo_full (&c->free_inc)) { +if (!heap_pop (&c->heap, b, bucket_min_cmp)) { +/* We don't want to be calling invalidate_buckets() +* multiple times when it can't do anything +*/ + c->invalidate_needs_gc =1 ; +bcache_queue_gc (c->set); +return ; + } + +invalidate_one_bucket (c, b); + } +} +void free_some_buckets (struct cache *c) +{ +long r;
drivers/block/bcache/alloc.c line 445
Quoted 10 lines
drivers/block/bcache/alloc.c new file +10
-0+ +/* +* XXX: do_discard(), prio_write() take refcounts on the cache set. How +* do we know that refcount is nonzero? +*/ + +do_discard (c); + + while (!fifo_full(&c->free) && + (fifo_used(&c->free) <= 8 ||
Ooh, devil!
Quoted 12 lines
drivers/block/bcache/alloc.c new file +12
-0+ !c->discard) && + (r = pop_freed(c)) != -1) +fifo_push (&c->free, r); + +while (c->prio_alloc !=prio_buckets (c) && +fifo_pop (&c->free, r)) { +struct bucket *b = c->buckets + r; + c->prio_next[c->prio_alloc++] = r; + + b->mark =GC_MARK_BTREE ; +atomic_dec_bug (&b->pin); + }
drivers/block/bcache/alloc.c line 467
Quoted 10 lines
drivers/block/bcache/alloc.c new file +10
-0+ +if (!CACHE_SYNC (&c->set->sb)) { +if (fifo_empty (&c->free_inc)) +invalidate_buckets (c); +return ; + } + +/* XXX: tracepoint for when c->need_save_prio > 64 */ + + if (c->need_save_prio <= 64 &&
Ooh, devil * devil!
Quoted 17 lines
drivers/block/bcache/alloc.c new file +17
-0+ fifo_used(&c->unused) > c->unused.size / 2) + return; + +if (atomic_read (&c->prio_written) >0 && + (fifo_empty (&c->free_inc) || + c->need_save_prio >64 )) +atomic_set (&c->prio_written,0 ); + +if (!can_save_prios (c)) +return ; + +invalidate_buckets (c); + +if (!fifo_empty (&c->free_inc) || + c->need_save_prio >64 ) +prio_write (c); +}
drivers/block/bcache/alloc.c line 494
Quoted 10 lines
drivers/block/bcache/alloc.c new file +10
-0+ +static long pop_bucket (struct cache *c,uint16_t priority,struct closure *cl) +{ +long r =-1 ; +again: +free_some_buckets (c); + +if ((priority == btree_prio || +fifo_used (&c->free) >8 ) && +fifo_pop (&c->free, r)) {
This is unconventional and more difficult to read than
if ((priority == btree_prio || fifo_used(&c->free) > 8) &&
fifo_pop(&c->free, r)) {It harms readability by both being unnecessarily different and visually less distinguishible. Why do this?
Quoted 33 lines
drivers/block/bcache/alloc.c new file +33
-0+struct bucket *b = c->buckets + r; +#ifdef CONFIG_BCACHE_EDEBUG +long i; +for (unsigned j =0 ; j <prio_buckets (c); j++) +BUG_ON (c->prio_buckets[j] == (uint64_t ) r); +for (unsigned j =0 ; j < c->prio_alloc; j++) +BUG_ON (c->prio_next[j] == (uint64_t ) r); + +fifo_for_each (i, &c->free) +BUG_ON (i == r); +fifo_for_each (i, &c->free_inc) +BUG_ON (i == r); +fifo_for_each (i, &c->unused) +BUG_ON (i == r); +#endif +BUG_ON (atomic_read (&b->pin) !=1 ); + + b->prio = priority; + b->mark = priority == btree_prio + ?GC_MARK_BTREE + : c->sb.bucket_size; +return r; + } + +pr_debug ("no free buckets, prio_written %i, blocked %i, " +"free %zu, free_inc %zu, unused %zu" , +atomic_read (&c->prio_written), +atomic_read (&c->set->prio_blocked),fifo_used (&c->free), +fifo_used (&c->free_inc),fifo_used (&c->unused)); + +if (cl) { +if (closure_blocking (cl)) +mutex_unlock (&c->set->bucket_lock);
drivers/block/bcache/alloc.c line 537
Quoted 10 lines
drivers/block/bcache/alloc.c new file +10
-0+ +closure_wait_event (&c->set->bucket_wait, cl, +atomic_read (&c->prio_written) >0 || +can_save_prios (c)); + +if (closure_blocking (cl)) { +mutex_lock (&c->set->bucket_lock); + goto again; + } + }
How is this different from using @gfp_flags (for %__GFP_WAIT) or bool @may_block + -EAGAIN return?
Quoted 43 lines
drivers/block/bcache/alloc.c new file +43
-0+return -1 ; +} + +void unpop_bucket (struct cache_set *c,struct bkey *k) +{ +for (unsigned i =0 ; i <KEY_PTRS (k); i++) { +struct bucket *b =PTR_BUCKET (c, k, i); + + b->mark =0 ; +bucket_add_unused (PTR_CACHE (c, k, i), b); + } +} + +int __pop_bucket_set (struct cache_set *c,uint16_t prio, +struct bkey *k,int n,struct closure *cl) +{ +lockdep_assert_held (&c->bucket_lock); +BUG_ON (!n || n > c->caches_loaded || n >8 ); + + k->header =KEY_HEADER (0 ,0 ); + +/* sort by free space/prio of oldest data in caches */ + +for (int i =0 ; i < n; i++) { +struct cache *ca = c->cache_by_alloc[i]; +long b =pop_bucket (ca, prio, cl); + +if (b ==-1 ) + goto err; + + k->ptr[i] =PTR (ca->buckets[b].gen, +bucket_to_sector (c, b), + ca->sb.nr_this_dev); + +SET_KEY_PTRS (k, i +1 ); + } + +return 0 ; +err: +unpop_bucket (c, k); +__bkey_put (c, k); +return -1 ; +}
...
drivers/block/bcache/request.c line 238
Quoted 11 lines
drivers/block/bcache/request.c new file +11
-0+static void bio_invalidate (struct closure *cl) +{ + struct btree_op *op = container_of(cl, struct btree_op, cl); + struct search *s = container_of(op, struct search, op); +struct bio *bio = s->cache_bio; + +pr_debug ("invalidating %i sectors from %llu" , +bio_sectors (bio), (uint64_t ) bio->bi_sector); + +while (bio_sectors (bio)) { +unsigned len =min (bio_sectors (bio),1U <<14 );
New line missing. Again, I'm not gonna complain about this more but please follow the usual formatting. There are cases where deviating can be beneficial / tolerated but IMHO you're deviating way too often for no good reasons (well, they're not apparent to me anyway).
Quoted 14 lines
drivers/block/bcache/request.c new file +14
-0+if (keylist_realloc (&s->op.keys,0 , s->op.d->c)) + goto out; + + bio->bi_sector += len; + bio->bi_size -= len <<9 ; + +keylist_add (&s->op.keys, + &KEY (s->op.d->id, bio->bi_sector, len)); + } + + s->bio_insert_done = true; +out: +continue_at (cl, bcache_journal, bcache_wq); +}
...
drivers/block/bcache/request.c line 330
Quoted 7 lines
drivers/block/bcache/request.c new file +7
-0+static struct open_bucket *get_data_bucket (struct bkey *search, +struct search *s) +{ +struct closure cl, *w =NULL ; +struct cache_set *c = s->op.d->c; +struct open_bucket *l, *ret, *ret_task; +
Unnecessary new line.
drivers/block/bcache/request.c line 331
Quoted 1 line
drivers/block/bcache/request.c new file +1
-0+BKEY_PADDED (key) alloc;
Why BKEY_PADDED()? What does it do? Can we not do this?
Quoted 6 lines
drivers/block/bcache/request.c new file +6
-0+struct bkey *k =NULL ; + +if (s->writeback) { +closure_init_stack (&cl); + w = &cl; + }
drivers/block/bcache/request.c line 347
Quoted 10 lines
drivers/block/bcache/request.c new file +10
-0+again: + ret = ret_task =NULL ; + +spin_lock (&c->data_bucket_lock); +list_for_each_entry_reverse (l, &c->data_buckets, list) +if (!bkey_cmp (&l->key, search)) { + ret = l; + goto found; + }else if (l->last == s->task) + ret_task = l;
if () {
} else if () {
}
Also, it's better to always use braces in outer constructs if inner needs one.
And, it seems the bucket allocations follow the task. What's the benefit of doing so? Why isn't there any explanation?
drivers/block/bcache/request.c line 360
Quoted 13 lines
drivers/block/bcache/request.c new file +13
-0+ + ret = ret_task ?:list_first_entry (&c->data_buckets, + struct open_bucket, list); +found: +if (!ret->sectors_free) { +if (!k) { +spin_unlock (&c->data_bucket_lock); + k = &alloc.key; + +if (pop_bucket_set (c, initial_prio, k,1 , w)) +return NULL ; + + goto again;
So, this is "try-locked-first, on failure, unlock-alloc-retry" dancing. Constructs like this aren't too atypical but they still warrant short explanation. Please be nice to people trying to read your code.
Quoted 11 lines
drivers/block/bcache/request.c new file +11
-0+ } + +bkey_copy (&ret->key, k); + k =NULL ; + + ret->sectors_free = c->sb.bucket_size; + }else +for (unsigned i =0 ; i <KEY_PTRS (&ret->key); i++) +EBUG_ON (ptr_stale (c, &ret->key, i)); + +if (k)
drivers/block/bcache/request.c line 381
Quoted 10 lines
drivers/block/bcache/request.c new file +10
-0+__bkey_put (c, k); + +if (w) +for (unsigned i =0 ; i <KEY_PTRS (&ret->key); i++) +PTR_BUCKET (c, &ret->key, i)->mark =GC_MARK_DIRTY ; + + ret->last = s->task; +bkey_copy_key (&ret->key, search); + +list_move_tail (&ret->list, &c->data_buckets);
This too. It's a rather common pattern and people would be able to just read through without thinking if it had one line comment saying something like /* @ret is hot now, put it at the head of queue */.
Quoted 2 lines
(quoted diff) +2
-0+ return ret; +}
...
Quoted 1 line
+static void
bio_insert(struct closure *cl)
Too generic name. This and a lot of others. Note that there are issues other than direct compile time symbol collision - it makes the code difficult to grep for and stack traces difficult to decipher. I'm not gonna complain more about too generic names but please review the code and fix other instances too.
Another thing is that why this function and its friends take @cl when they always expect @cl contained inside search->op. Why not take @search instead? Using @cl is more dangerous and less readable. Why do it?
Quoted 14 lines
drivers/block/bcache/request.c new file +14
-0+{ + struct btree_op *op = container_of(cl, struct btree_op, cl); + struct search *s = container_of(op, struct search, op); +struct bio *bio = s->cache_bio; + +if (!s->skip) { + bio->bi_end_io = bio_insert_endio; + bio->bi_private = cl; +bio_get (bio); + } + +keylist_init (&op->keys); +bio_insert_loop (cl); +}
...
drivers/block/bcache/request.c line 617
Quoted 6 lines
drivers/block/bcache/request.c new file +6
-0+static void __do_bio_hook (struct search *s) +{ +struct bio *bio = &s->bio.bio; +memcpy (bio, s->orig_bio,sizeof (struct bio )); + +#ifdef CONFIG_DISKMON
Contamination.
Quoted 10 lines
drivers/block/bcache/request.c new file +10
-0+ bio->bi_flowid =NULL ; +#endif + bio->bi_end_io = request_endio; + bio->bi_private = &s->cl; + bio->bi_destructor =NULL ; +atomic_set (&bio->bi_cnt,3 ); +} + +static struct search *do_bio_hook (struct bio *bio,struct bcache_device *d) +{
drivers/block/bcache/request.c line 637
Quoted 10 lines
drivers/block/bcache/request.c new file +10
-0+struct bio_vec *bv; +struct search *s =mempool_alloc (d->c->search,GFP_NOIO ); + memset(s, 0, offsetof(struct search, op.keys)); + +__closure_init (&s->cl,NULL ); +__closure_init (&s->op.cl, &s->cl); + + s->op.d = d; + s->op.lock =-1 ; + s->task =get_current ();
Please use current instead of get_current().
Quoted 17 lines
drivers/block/bcache/request.c new file +17
-0+ s->orig_bio = bio; + s->write = bio->bi_rw &REQ_WRITE ; + s->op.flush_journal = bio->bi_rw &REQ_FLUSH ; + s->recoverable =1 ; +__do_bio_hook (s); + +if (bio->bi_size !=bio_segments (bio) *PAGE_SIZE ) { + bv =mempool_alloc (d->unaligned_bvec,GFP_NOIO ); +memcpy (bv,bio_iovec (bio), +sizeof (struct bio_vec ) *bio_segments (bio)); + + s->bio.bio.bi_io_vec = bv; + s->unaligned_bvec =1 ; + } + +return s; +}
...
drivers/block/bcache/request.c line 935
Quoted 7 lines
drivers/block/bcache/request.c new file +7
-0+static bool should_writeback (struct cached_dev *d,struct bio *bio) +{ +return !atomic_read (&d->disk.detaching) && +cache_mode (d, bio) ==CACHE_MODE_WRITEBACK && + (d->disk.c->gc_stats.in_use < (bio->bi_rw &REQ_SYNC ) + ?CUTOFF_WRITEBACK_SYNC + :CUTOFF_WRITEBACK );
The formatting of the CUTOFF_WRITEBACK* test is atrocious. It almost looks like it's trying to mislead the reader. For $DIETY's sake, use a local variable for the threshold value or split the condition into a few "if () return;" clauses.
drivers/block/bcache/request.c line 948
Quoted 13 lines
drivers/block/bcache/request.c new file +13
-0+} + +static void request_write_resubmit (struct closure *cl) +{ + struct btree_op *op = container_of(cl, struct btree_op, cl); + struct search *s = container_of(op, struct search, op); +struct bio *bio = &s->bio.bio; + +closure_bio_submit (bio, &s->cl, op->d->c->bio_split); + +bio_insert (&s->op.cl); +continue_at (&s->cl, cached_dev_write_complete,NULL ); +}
I'm kinda turned off by closure here too. It doesn't really seem to simplify the actual painful points of async programming. The user still has to compose separate paths for sync and async paths. I keep thinking domain-specific sequencer would be much better.
Quoted 10 lines
drivers/block/bcache/request.c new file +10
-0+ +static void request_write (struct cached_dev *d,struct search *s) +{ +struct closure *cl = &s->cl; +struct bio *bio = &s->bio.bio; + +check_should_skip (d, s); +down_read_non_owner (&d->writeback_lock); + +if (bcache_in_writeback (d, bio->bi_sector,bio_sectors (bio))) {
drivers/block/bcache/request.c line 968
Quoted 10 lines
drivers/block/bcache/request.c new file +10
-0+ s->skip = false; + s->writeback = true; + } + +if (s->skip) { +skip: s->cache_bio = s->orig_bio; +bio_get (s->cache_bio); +trace_bcache_write_skip (s->orig_bio); + +if (bio->bi_rw & (1 <<BIO_RW_DISCARD )) {
This isn't bcache's problem but it probably would be better to make block layer handle this in generic manner. blk_queue_discard() already indicates whether a queue supports discard or not. generic_make_request() can simply treat discards as no-op if unsupported.
Quoted 28 lines
drivers/block/bcache/request.c new file +28
-0+closure_get (cl); + +if (blk_queue_discard (bdev_get_queue (d->bdev))) +generic_make_request (bio); +else +bio_endio (bio,0 ); + + goto out; + }else + goto submit; + } + +if (should_writeback (d, s->orig_bio)) + s->writeback = true; + +if (!s->writeback) { + s->cache_bio =bbio_kmalloc (GFP_NOIO , bio->bi_max_vecs); +if (!s->cache_bio) { + s->skip = true; + goto skip; + } + +__bio_clone (s->cache_bio, bio); +trace_bcache_writethrough (s->orig_bio); +submit: +if (closure_bio_submit (bio, cl, s->op.d->c->bio_split)) + continue_at(&s->op.cl, + request_write_resubmit,
drivers/block/bcache/request.c line 1006
Quoted 10 lines
drivers/block/bcache/request.c new file +10
-0+ bcache_wq); + }else { + s->cache_bio = bio; +trace_bcache_writeback (s->orig_bio); +bcache_writeback_add (d,bio_sectors (bio)); + } +out: +bio_insert (&s->op.cl); +continue_at (cl, cached_dev_write_complete,NULL ); +}
I hate how gotos are being abused in this function. This ain't 80s and we don't build complex control flow using gotos. If common logic is used in different parts of the control flow in a way that the usual control constructs don't really yield pretty code, factor out the common part into a function. Are you not doing that because you don't wanna put continue_at() inside another function which may obscure the closure control flow? If that's the case, I think it just shows how retarded wrapping return in macros is. :(
drivers/block/bcache/request.c line 1238
Quoted 8 lines
drivers/block/bcache/request.c new file +8
-0+static void cached_dev_make_request (struct request_queue *q,struct bio *bio) +{ +struct search *s; +struct bcache_device *d = bio->bi_bdev->bd_disk->private_data; + struct cached_dev *dc = container_of(d, struct cached_dev, disk); + + bio->bi_bdev = dc->bdev; + bio->bi_sector +=16 ;
^^^^
Please don't do this. Use of magic numbers seems pretty common throughout the code base. This is error-prone and cryptic. Use enums or macros (this is what macros are for, actually) to give them meaningful names. If applicable, explain why the specific number is chosen on constant definition. I assume this is the size of superblock but I can't ask cscope about it or grep for it.
drivers/block/bcache/request.c line 1246
Quoted 8 lines
drivers/block/bcache/request.c new file +8
-0+ +if (cached_dev_get (dc)) { + s =do_bio_hook (bio, d); +trace_bcache_request_start (&s->op, bio); + + (!bio_has_data (bio) ? request_nodata : + bio->bi_rw &REQ_WRITE ? request_write : + request_read)(dc, s);
Don't do this. Among other things, it should be possible to search / grep for "FUNCTION_NAME(" and find all the direct invocations. Just use if/else. You're not gaining anything from doing things like the above while basically aggravating other developers trying to understand your code.
drivers/block/bcache/request.c line 1249
Quoted 3 lines
drivers/block/bcache/request.c new file +3
-0+ }else +bio_passthrough (dc, bio); +}
Thanks.
Signature · 1 line
tejun
PATCH v13 15/16 bcache: Writeback
In reply to Kent Overstreet--- drivers/block/bcache/writeback.c | 518 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 518 insertions(+), 0 deletions(-) create mode 100644 drivers/block/bcache/writeback.c
drivers/block/bcache/writeback.c new file +518 -0
@@ -0,0 +1,518 @@ +#include "bcache.h" +#include "btree.h" +#include "debug.h" + +static struct workqueue_struct *dirty_wq; + +static void read_dirty (struct cached_dev *); + +/* Background writeback */ + +static void dirty_init (struct dirty *w) +{ +struct bio *bio = &w->io->bio; + +bio_init (bio); +bio_get (bio); +if (!w->io->d->writeback_percent) +bio_set_prio (bio,IOPRIO_PRIO_VALUE (IOPRIO_CLASS_IDLE ,0 )); + + bio->bi_size =KEY_SIZE (&w->key) <<9 ; + bio->bi_max_vecs =DIV_ROUND_UP (KEY_SIZE (&w->key),PAGE_SECTORS ); + bio->bi_private = w; +bio_map (bio,NULL ); +} + +static int dirty_cmp (struct dirty *r,struct dirty *l) +{ +/* Overlapping keys must compare equal */ +if (KEY_START (&r->key) >= l->key.key) +return 1 ; +if (KEY_START (&l->key) >= r->key.key) +return -1 ; +return 0 ; +} + +static int btree_refill_dirty_leaf (struct btree *b,struct btree_op *op, +struct cached_dev *dc) +{ +struct dirty *w; +struct btree_iter iter; +btree_iter_init (b, &iter, &KEY (op->d->id, dc->last_found,0 )); + +/* To protect rb tree access vs. read_dirty() */ +spin_lock (&dc->dirty_lock); + +while (!array_freelist_empty (&dc->dirty_freelist)) { +struct bkey *k =btree_iter_next (&iter); +if (!k ||KEY_DEV (k) != op->d->id) +break ; + +if (ptr_bad (b, k)) +continue ; + +if (KEY_DIRTY (k)) { + w =array_alloc (&dc->dirty_freelist); + + dc->last_found = k->key; +pr_debug ("%s" ,pkey (k)); + w->io =NULL ; +bkey_copy (&w->key, k); +SET_KEY_DIRTY (&w->key, false); + +if (RB_INSERT (&dc->dirty, w, node, dirty_cmp)) +array_free (&dc->dirty_freelist, w); + } + } + +spin_unlock (&dc->dirty_lock); + +return 0 ; +} + +static int btree_refill_dirty (struct btree *b,struct btree_op *op, +struct cached_dev *dc) +{ +int r; +struct btree_iter iter; +btree_iter_init (b, &iter, &KEY (op->d->id, dc->last_found,0 )); + +if (!b->level) +return btree_refill_dirty_leaf (b, op, dc); + +while (!array_freelist_empty (&dc->dirty_freelist)) { +struct bkey *k =btree_iter_next (&iter); +if (!k) +break ; + +if (ptr_bad (b, k)) +continue ; + + r =btree (refill_dirty, k, b, op, dc); +if (r) { +char buf[BDEVNAME_SIZE ]; +bdevname (dc->bdev, buf); + +printk (KERN_WARNING "Error trying to read the btree " +"for background writeback on %s: " +"dirty data may have been lost!\n" , buf); + } + +if (KEY_DEV (k) != op->d->id) +break ; + +cond_resched (); + } + +return 0 ; +} + +static void refill_dirty (struct work_struct *work) +{ +struct cached_dev *dc =container_of (to_delayed_work (work), + struct cached_dev, refill_dirty); +uint64_t start; + +struct btree_op op; +btree_op_init_stack (&op); + op.d = &dc->disk; + +if (!atomic_read (&dc->disk.detaching) && + !dc->writeback_running) +return ; + +down_write (&dc->writeback_lock); + start = dc->last_found; + +if (!atomic_read (&dc->has_dirty)) { +SET_BDEV_STATE (&dc->sb,BDEV_STATE_CLEAN ); +write_bdev_super (dc,NULL ); +up_write (&dc->writeback_lock); +return ; + } + +btree_root (refill_dirty, dc->disk.c, &op, dc); +closure_sync (&op.cl); + +pr_debug ("found %s keys on %i from %llu to %llu, %i%% used" , +RB_EMPTY_ROOT (&dc->dirty) ?"no" : +array_freelist_empty (&dc->dirty_freelist) ?"some" :"a few" , + dc->disk.id, start, (uint64_t ) dc->last_found, + dc->disk.c->gc_stats.in_use); + +/* Got to the end of the btree */ +if (!array_freelist_empty (&dc->dirty_freelist)) + dc->last_found =0 ; + +/* Searched the entire btree - delay for awhile */ +if (!array_freelist_empty (&dc->dirty_freelist) && !start) +queue_delayed_work (dirty_wq, &dc->refill_dirty, + dc->writeback_delay *HZ ); + +spin_lock (&dc->dirty_lock); + +if (!RB_EMPTY_ROOT (&dc->dirty)) { +struct dirty *w; + w = RB_FIRST(&dc->dirty, struct dirty, node); + dc->writeback_start =KEY_START (&w->key); + + w = RB_LAST(&dc->dirty, struct dirty, node); + dc->writeback_end = w->key.key; + }else { + dc->writeback_start =0 ; + dc->writeback_end =0 ; + +if (!start) { +atomic_set (&dc->has_dirty,0 ); +cached_dev_put (dc); + } + } + +up_write (&dc->writeback_lock); + + dc->next_writeback_io =local_clock (); +read_dirty (dc); +} + +bool bcache_in_writeback (struct cached_dev *dc,sector_t offset,unsigned len) +{ +struct dirty *w, s; + s.key =KEY (dc->disk.id, offset + len, len); + +if (offset >= dc->writeback_end || + offset + len <= dc->writeback_start) +return false; + +spin_lock (&dc->dirty_lock); + w =RB_SEARCH (&dc->dirty, s, node, dirty_cmp); +if (w && !w->io) { +rb_erase (&w->node, &dc->dirty); +array_free (&dc->dirty_freelist, w); + w =NULL ; + } + +spin_unlock (&dc->dirty_lock); +return w !=NULL ; +} + +void bcache_writeback_queue (struct cached_dev *d) +{ +queue_delayed_work (dirty_wq, &d->refill_dirty,0 ); +} + +void bcache_writeback_add (struct cached_dev *d,unsigned sectors) +{ +atomic_long_add (sectors, &d->disk.sectors_dirty); + +if (!atomic_read (&d->has_dirty) && + !atomic_xchg (&d->has_dirty,1 )) { +if (BDEV_STATE (&d->sb) !=BDEV_STATE_DIRTY ) { +SET_BDEV_STATE (&d->sb,BDEV_STATE_DIRTY ); +/* XXX: should do this synchronously */ +write_bdev_super (d,NULL ); + } + +atomic_inc (&d->count); +queue_delayed_work (dirty_wq, &d->refill_dirty, + d->writeback_delay *HZ ); + +if (d->writeback_percent) +schedule_delayed_work (&d->writeback_rate_update, + d->writeback_rate_update_seconds *HZ ); + } +} + +static void __update_writeback_rate (struct cached_dev *dc) +{ +struct cache_set *c = dc->disk.c; +uint64_t cache_sectors = c->nbuckets * c->sb.bucket_size; +uint64_t cache_dirty_target = +div_u64 (cache_sectors * dc->writeback_percent,100 ); + +int64_t target =div64_u64 (cache_dirty_target *bdev_sectors (dc->bdev), + c->cached_dev_sectors); + +/* PD controller */ + +int change =0 ; +int64_t error; +int64_t dirty =atomic_long_read (&dc->disk.sectors_dirty); +int64_t derivative = dirty - dc->disk.sectors_dirty_last; + + dc->disk.sectors_dirty_last = dirty; + + derivative *= dc->writeback_rate_d_term; + derivative =clamp (derivative, -dirty, dirty); + + derivative =ewma_add (dc->disk.sectors_dirty_derivative, derivative, + dc->writeback_rate_d_smooth,0 ); + +/* Avoid divide by zero */ +if (!target) + goto out; + + error =div64_s64 ((dirty + derivative - target) <<8 , target); + + change =div_s64 ((dc->writeback_rate * error) >>8 , + dc->writeback_rate_p_term_inverse); + +/* Don't increase writeback rate if the device isn't keeping up */ +if (change >0 && +time_after64 (local_clock (), + dc->next_writeback_io +10 *NSEC_PER_MSEC )) + change =0 ; + + dc->writeback_rate =clamp_t (int64_t, dc->writeback_rate + change, +1 ,NSEC_PER_MSEC ); +out: + dc->writeback_rate_derivative = derivative; + dc->writeback_rate_change = change; + dc->writeback_rate_target = target; + +schedule_delayed_work (&dc->writeback_rate_update, + dc->writeback_rate_update_seconds *HZ ); +} + +static void update_writeback_rate (struct work_struct *work) +{ +struct cached_dev *dc =container_of (to_delayed_work (work), + struct cached_dev, + writeback_rate_update); + +down_read (&dc->writeback_lock); + +if (atomic_read (&dc->has_dirty) && + dc->writeback_percent) +__update_writeback_rate (dc); + +up_read (&dc->writeback_lock); +} + +static unsigned writeback_delay (struct cached_dev *dc,unsigned sectors) +{ +uint64_t now =local_clock (); + +if (atomic_read (&dc->disk.detaching) || + !dc->writeback_percent) +return 0 ; + +/* writeback_rate = sectors per 10 ms */ + dc->next_writeback_io +=div_u64 (sectors *10000000ULL , + dc->writeback_rate); + +return time_after64 (dc->next_writeback_io, now) + ?div_u64 (dc->next_writeback_io - now,NSEC_PER_SEC /HZ ) + :0 ; +} + +/* Background writeback - IO loop */ + +static void write_dirty_finish (struct closure *cl) +{ + struct dirty_io *io = container_of(cl, struct dirty_io, cl); +struct dirty *w = io->bio.bi_private; +struct cached_dev *dc = io->d; +struct bio_vec *bv =bio_iovec_idx (&io->bio, io->bio.bi_vcnt); + +while (bv-- != w->io->bio.bi_io_vec) +__free_page (bv->bv_page); + +closure_debug_destroy (cl); +kfree (io); + +/* This is kind of a dumb way of signalling errors. */ +if (!KEY_DIRTY (&w->key)) { +struct btree_op op; +btree_op_init_stack (&op); + + op.type =BTREE_REPLACE ; +bkey_copy (&op.replace, &w->key); +SET_KEY_DIRTY (&op.replace, true); + +keylist_add (&op.keys, &w->key); + +for (unsigned i =0 ; i <KEY_PTRS (&w->key); i++) +atomic_inc (&PTR_BUCKET (dc->disk.c, &w->key, i)->pin); + +pr_debug ("clearing %s" ,pkey (&w->key)); +bcache_btree_insert (&op, dc->disk.c); +closure_sync (&op.cl); + +atomic_long_inc (op.insert_collision + ? &dc->disk.c->writeback_keys_failed + : &dc->disk.c->writeback_keys_done); + } + +spin_lock (&dc->dirty_lock); +rb_erase (&w->node, &dc->dirty); +array_free (&dc->dirty_freelist, w); +atomic_dec_bug (&dc->in_flight); + +read_dirty (dc); +} + +static void dirty_endio (struct bio *bio,int error) +{ +struct dirty *w = bio->bi_private; + +if (error) +SET_KEY_DIRTY (&w->key, true); + +bio_put (bio); +closure_put (&w->io->cl); +} + +static void write_dirty (struct closure *cl) +{ + struct dirty_io *io = container_of(cl, struct dirty_io, cl); +struct dirty *w = io->bio.bi_private; + +dirty_init (w); + io->bio.bi_rw =WRITE |REQ_UNPLUG ; + io->bio.bi_sector =KEY_START (&w->key); + io->bio.bi_bdev = io->d->bdev; + io->bio.bi_end_io = dirty_endio; + +trace_bcache_write_dirty (&w->io->bio); +closure_bio_submit (&w->io->bio, cl, io->d->disk.bio_split); + +continue_at (&io->cl, write_dirty_finish, dirty_wq); +} + +static void read_dirty_endio (struct bio *bio,int error) +{ +struct dirty *w = bio->bi_private; + +count_io_errors (PTR_CACHE (w->io->d->disk.c, &w->key,0 ), + error,"reading dirty data from cache" ); + +dirty_endio (bio, error); +} + +static void read_dirty (struct cached_dev *dc) +{ +unsigned delay =writeback_delay (dc,0 ); +struct dirty *w; +struct dirty_io *io; + +/* XXX: if we error, background writeback could stall indefinitely */ + +while (1 ) { + w = RB_FIRST(&dc->dirty, struct dirty, node); + +while (w && w->io) + w =RB_NEXT (w, node); + +if (!w) +break ; + +BUG_ON (ptr_stale (dc->disk.c, &w->key,0 )); + +if (delay >0 && + (KEY_START (&w->key) != dc->last_read || +jiffies_to_msecs (delay) >50 )) { +queue_delayed_work (dirty_wq, &dc->read_dirty, delay); +break ; + } + + dc->last_read = w->key.key; + w->io =ERR_PTR (-EINTR ); +spin_unlock (&dc->dirty_lock); + + io =kzalloc (sizeof (struct dirty_io ) +sizeof (struct bio_vec ) + *DIV_ROUND_UP (KEY_SIZE (&w->key),PAGE_SECTORS ), +GFP_KERNEL ); +if (!io) + goto err; + + w->io = io; + w->io->d = dc; + +dirty_init (w); + w->io->bio.bi_sector =PTR_OFFSET (&w->key,0 ); + w->io->bio.bi_bdev =PTR_CACHE (dc->disk.c, + &w->key,0 )->bdev; + w->io->bio.bi_rw =READ |REQ_UNPLUG ; + w->io->bio.bi_end_io = read_dirty_endio; + +if (bio_alloc_pages (&w->io->bio,GFP_KERNEL )) + goto err; + +pr_debug ("%s" ,pkey (&w->key)); + +closure_init (&w->io->cl,NULL ); +set_closure_fn (&w->io->cl, write_dirty, dirty_wq); +closure_set_stopped (&w->io->cl); + +trace_bcache_read_dirty (&w->io->bio); +closure_bio_submit_put (&w->io->bio, &w->io->cl, + dc->disk.bio_split); + + delay =writeback_delay (dc,KEY_SIZE (&w->key)); + +if (atomic_inc_return (&dc->in_flight) >=128 ) +return ; + +spin_lock (&dc->dirty_lock); + } + +if (0 ) { +err:spin_lock (&dc->dirty_lock); +if (!IS_ERR_OR_NULL (w->io)) +kfree (w->io); +rb_erase (&w->node, &dc->dirty); +array_free (&dc->dirty_freelist, w); + } + +if (RB_EMPTY_ROOT (&dc->dirty)) +queue_delayed_work (dirty_wq, &dc->refill_dirty,0 ); + +spin_unlock (&dc->dirty_lock); +} + +static void read_dirty_work (struct work_struct *work) +{ +struct cached_dev *dc =container_of (to_delayed_work (work), + struct cached_dev, read_dirty); + +spin_lock (&dc->dirty_lock); +read_dirty (dc); +} + +void bcache_writeback_init_cached_dev (struct cached_dev *d) +{ +INIT_DELAYED_WORK (&d->refill_dirty, refill_dirty); +INIT_DELAYED_WORK (&d->read_dirty, read_dirty_work); +init_rwsem (&d->writeback_lock); +array_allocator_init (&d->dirty_freelist); + + d->dirty =RB_ROOT ; + d->writeback_metadata = true; + d->writeback_running = true; + d->writeback_delay =30 ; + d->writeback_rate =1024 ; + + d->writeback_rate_update_seconds =30 ; + d->writeback_rate_d_term =16 ; + d->writeback_rate_p_term_inverse =64 ; + d->writeback_rate_d_smooth =8 ; + +INIT_DELAYED_WORK (&d->writeback_rate_update, update_writeback_rate); +schedule_delayed_work (&d->writeback_rate_update, + d->writeback_rate_update_seconds *HZ ); +} + +void bcache_writeback_exit (void ) +{ +if (dirty_wq) +destroy_workqueue (dirty_wq); +} + +int __init bcache_writeback_init (void ) +{ + dirty_wq =create_singlethread_workqueue ("bcache_writeback" ); +if (!dirty_wq) +return -ENOMEM ; + +return 0 ; +}
Signature · 1 line
1.7.9.rc2
PATCH v13 16/16 bcache: Debug and tracing code
In reply to Kent Overstreet--- drivers/block/bcache/debug.c | 574 ++++++++++++++++++++++++++++++++++++++++++ drivers/block/bcache/debug.h | 53 ++++ drivers/block/bcache/trace.c | 26 ++ 3 files changed, 653 insertions(+), 0 deletions(-) create mode 100644 drivers/block/bcache/debug.c create mode 100644 drivers/block/bcache/debug.h create mode 100644 drivers/block/bcache/trace.c
drivers/block/bcache/debug.c new file +574 -0
@@ -0,0 +1,574 @@ + +#include "bcache.h" +#include "btree.h" +#include "debug.h" +#include "request.h" + +#include <linux/console.h> +#include <linux/debugfs.h> +#include <linux/module.h> +#include <linux/random.h> +#include <linux/seq_file.h> + +static struct dentry *debug; + +/* Various debug code */ + +const char *ptr_status (struct cache_set *c,const struct bkey *k) +{ +for (unsigned i =0 ; i <KEY_PTRS (k); i++) +if (ptr_available (c, k, i)) { +struct cache *ca =PTR_CACHE (c, k, i); +size_t bucket =PTR_BUCKET_NR (c, k, i); +size_t r =bucket_remainder (c,PTR_OFFSET (k, i)); + +if (KEY_SIZE (k) + r > c->sb.bucket_size) +return "bad, length too big" ; +if (bucket < ca->sb.first_bucket) +return "bad, short offset" ; +if (bucket >= ca->sb.nbuckets) +return "bad, offset past end of device" ; +if (ptr_stale (c, k, i)) +return "stale" ; + } + +if (!bkey_cmp (k, &ZERO_KEY )) +return "bad, null key" ; +if (!KEY_PTRS (k)) +return "bad, no pointers" ; +if (!KEY_SIZE (k)) +return "zeroed key" ; +return "" ; +} + +static bool skipped_backwards (struct btree *b,struct bkey *k) +{ +return bkey_cmp (k, (!b->level) ? &START_KEY (next (k)) :next (k)) >0 ; +} + +static void dump_bset (struct btree *b,struct bset *i) +{ +for (struct bkey *k = i->start; k <end (i); k =next (k)) { +printk (KERN_ERR "block %zu key %zu/%i: %s" ,index (i, b), + (uint64_t *) k - i->d, i->keys,pkey (k)); + +for (unsigned j =0 ; j <KEY_PTRS (k); j++) { +size_t n =PTR_BUCKET_NR (b->c, k, j); +printk (" bucket %zu" , n); + +if (n >= b->c->sb.first_bucket && n < b->c->sb.nbuckets) +printk (" prio %i" , +PTR_BUCKET (b->c, k, j)->prio); + } + +printk (" %s\n" ,ptr_status (b->c, k)); + +if (next (k) <end (i) && +skipped_backwards (b, k)) +printk (KERN_ERR "Key skipped backwards\n" ); + } +} + +static void vdump_bucket_and_panic (struct btree *b,const char *m,va_list args) +{ +struct bset *i; + +console_lock (); + +for_each_sorted_set (b, i) +dump_bset (b, i); + +vprintk (m, args); + +console_unlock (); + +panic ("at %s\n" ,pbtree (b)); +} + +static void dump_bucket_and_panic (struct btree *b,const char *m, ...) +{ +va_list args; +va_start (args, m); +vdump_bucket_and_panic (b, m, args); +va_end (args); +} + +static void __maybe_unused +dump_key_and_panic (struct btree *b,struct bset *i,int j) +{ +long bucket =PTR_BUCKET_NR (b->c,node (i, j),0 ); +long r =PTR_OFFSET (node (i, j),0 ) & ~(~0 << b->c->bucket_bits); + +printk (KERN_ERR "level %i block %zu key %i/%i: %s " +"bucket %llu offset %li into bucket\n" , + b->level,index (i, b), j, i->keys,pkey (node (i, j)), + (uint64_t ) bucket, r); +dump_bucket_and_panic (b,"" ); +} + +struct keyprint_hack bcache_pkey (const struct bkey *k) +{ +unsigned i =0 ; +struct keyprint_hack r; +char *out = r.s, *end = r.s +KEYHACK_SIZE ; + +#define p (...) (out += scnprintf(out, end - out, __VA_ARGS__)) + +p ("%llu:%llu len %llu -> [" ,KEY_DEV (k), k->key,KEY_SIZE (k)); + +if (KEY_PTRS (k)) +while (1 ) { +p ("%llu:%llu gen %llu" , +PTR_DEV (k, i),PTR_OFFSET (k, i),PTR_GEN (k, i)); + +if (++i ==KEY_PTRS (k)) +break ; + +p (", " ); + } + +p ("]" ); + +if (KEY_DIRTY (k)) +p (" dirty" ); +if (KEY_CSUM (k)) +p (" cs%llu %llx" ,KEY_CSUM (k), k->ptr[1 ]); +#undef p +return r; +} + +struct keyprint_hack bcache_pbtree (const struct btree *b) +{ +struct keyprint_hack r; + +snprintf (r.s,40 ,"%li level %i/%i" ,PTR_BUCKET_NR (b->c, &b->key,0 ), + b->level, b->c->root ? b->c->root->level :-1 ); +return r; +} + +#ifdef CONFIG_BCACHE_DEBUG + +void btree_verify (struct btree *b,struct bset *new) +{ +struct btree *v = b->c->verify_data; +struct closure cl; +closure_init_stack (&cl); + +if (!b->c->verify) +return ; + +closure_wait_event (&b->io.wait, &cl, +atomic_read (&b->io.cl.remaining) ==-1 ); + +mutex_lock (&b->c->verify_lock); + +bkey_copy (&v->key, &b->key); + v->written =0 ; + v->level = b->level; + +btree_read (v); +closure_wait_event (&v->io.wait, &cl, +atomic_read (&b->io.cl.remaining) ==-1 ); + +if (new->keys != v->sets[0 ].data->keys || +memcmp (new->start, + v->sets[0 ].data->start, + (void *)end (new) - (void *) new->start)) { +struct bset *i; +unsigned j; + +console_lock (); + +printk (KERN_ERR "*** original memory node:\n" ); +for_each_sorted_set (b, i) +dump_bset (b, i); + +printk (KERN_ERR "*** sorted memory node:\n" ); +dump_bset (b, new); + +printk (KERN_ERR "*** on disk node:\n" ); +dump_bset (v, v->sets[0 ].data); + +for (j =0 ; j < new->keys; j++) +if (new->d[j] != v->sets[0 ].data->d[j]) +break ; + +console_unlock (); +panic ("verify failed at %u\n" , j); + } + +mutex_unlock (&b->c->verify_lock); +} + +static void data_verify_endio (struct bio *bio,int error) +{ +struct closure *cl = bio->bi_private; +closure_put (cl); +} + +void data_verify (struct search *s) +{ +char name[BDEVNAME_SIZE ]; + struct cached_dev *dc = container_of(s->op.d, struct cached_dev, disk); +struct closure *cl = &s->cl; +struct bio *check; +struct bio_vec *bv; +int i; + +if (!s->unaligned_bvec) +bio_for_each_segment (bv, s->orig_bio, i) + bv->bv_offset =0 , bv->bv_len =PAGE_SIZE ; + + check =bio_clone (s->orig_bio,GFP_NOIO ); +if (!check) +return ; + +if (bio_alloc_pages (check,GFP_NOIO )) + goto out_put; + + check->bi_rw =READ_SYNC ; + check->bi_private = cl; + check->bi_end_io = data_verify_endio; + +closure_bio_submit (check, cl, s->op.d->c->bio_split); +closure_sync (cl); + +bio_for_each_segment (bv, s->orig_bio, i) { +void *p1 =kmap (bv->bv_page); +void *p2 =kmap (check->bi_io_vec[i].bv_page); + +if (memcmp (p1 + bv->bv_offset, + p2 + bv->bv_offset, + bv->bv_len)) +printk (KERN_ERR "bcache (%s): verify failed" +" at sector %llu\n" , +bdevname (dc->bdev, name), + (uint64_t ) s->orig_bio->bi_sector); + +kunmap (bv->bv_page); +kunmap (check->bi_io_vec[i].bv_page); + } + +__bio_for_each_segment (bv, check, i,0 ) +__free_page (bv->bv_page); +out_put: +bio_put (check); +} + +#endif + +#ifdef CONFIG_BCACHE_EDEBUG + +unsigned count_data (struct btree *b) +{ +unsigned ret =0 ; +struct bkey *k; + +if (!b->level) +for_each_key (b, k) + ret +=KEY_SIZE (k); +return ret; +} + +void check_key_order_msg (struct btree *b,struct bset *i,const char *m, ...) +{ +if (!i->keys) +return ; + +for (struct bkey *k = i->start;next (k) <end (i); k =next (k)) +if (skipped_backwards (b, k)) { +va_list args; +va_start (args, m); + +vdump_bucket_and_panic (b, m, args); +va_end (args); + } +} + +void check_keys (struct btree *b,const char *m, ...) +{ +va_list args; +struct bkey *k, *p; +struct btree_iter iter; + +if (b->level) +return ; + +btree_iter_init (b, &iter,NULL ); + +do + p =btree_iter_next (&iter); +while (p &&ptr_invalid (b, p)); + +while ((k =btree_iter_next (&iter))) { +if (bkey_cmp (&START_KEY (p), &START_KEY (k)) >0 ) { +printk (KERN_ERR "Keys out of order:\n" ); + goto bug; + } + +if (ptr_invalid (b, k)) +continue ; + +if (bkey_cmp (p, &START_KEY (k)) >0 ) { +printk (KERN_ERR "Overlapping keys:\n" ); + goto bug; + } + p = k; + } +return ; +bug: +va_start (args, m); +vdump_bucket_and_panic (b, m, args); +va_end (args); +} + +#endif + +#ifdef CONFIG_DEBUG_FS + +static int btree_dump (struct btree *b,struct btree_op *op,struct seq_file *f, +const char *tabs,uint64_t *prev,uint64_t *sectors) +{ +struct bkey *k; +char buf[30 ]; +uint64_t last, biggest =0 ; + +for_each_key (b, k) { +int j = (uint64_t *) k - _t->data->d; +if (!j) + last = *prev; + +if (last > k->key) +seq_printf (f,"Key skipped backwards\n" ); + +if (!b->level && j && + last !=KEY_START (k)) +seq_printf (f,"<hole>\n" ); +else if (b->level && !ptr_bad (b, k)) +btree (dump, k, b, op, f, tabs -1 , &last, sectors); + +seq_printf (f,"%s%zi %4i: %s %s\n" , + tabs, _t - b->sets, j,pkey (k), buf); + +if (!b->level && !buf[0 ]) + *sectors +=KEY_SIZE (k); + + last = k->key; + biggest =max (biggest, last); + } + *prev = biggest; + +return 0 ; +} + +static int debug_seq_show (struct seq_file *f,void *data) +{ +static const char *tabs ="\t\t\t\t\t" ; +uint64_t last =0 , sectors =0 ; +struct cache *ca = f->private; +struct cache_set *c = ca->set; + +struct btree_op op; +btree_op_init_stack (&op); + +btree_root (dump, c, &op, f, &tabs[4 ], &last, §ors); + +seq_printf (f,"%s\n" "%llu Mb found\n" , +pkey (&c->root->key), sectors /2048 ); + +closure_sync (&op.cl); +return 0 ; +} + +static int debug_seq_open (struct inode *inode,struct file *file) +{ +return single_open (file, debug_seq_show, inode->i_private); +} + +static const struct file_operations cache_debug_ops = { + .owner =THIS_MODULE , + .open = debug_seq_open, + .read = seq_read, + .release = single_release +}; + +void bcache_debug_init_cache (struct cache *c) +{ +if (!IS_ERR_OR_NULL (debug)) { +char b[BDEVNAME_SIZE ]; +bdevname (c->bdev, b); + + c->debug =debugfs_create_file (b,0400 , debug, c, + &cache_debug_ops); + } +} + +#endif + +#ifdef CONFIG_BCACHE_DEBUG +static ssize_t btree_fuzz (struct kobject *k,struct kobj_attribute *a, +const char *buffer,size_t size) +{ +void dump (struct btree *b) + { +for (struct bset *i = b->sets[0 ].data; +index (i, b) <btree_blocks (b) && + i->seq == b->sets[0 ].data->seq; + i = ((void *) i) +set_blocks (i, b->c) *block_bytes (b->c)) +dump_bset (b, i); + } + +struct cache_sb *sb; +struct cache_set *c; +struct btree *all[3 ], *b, *fill, *orig; + +struct btree_op op; +btree_op_init_stack (&op); + + sb =kzalloc (sizeof (struct cache_sb ),GFP_KERNEL ); +if (!sb) +return -ENOMEM ; + + sb->bucket_size =128 ; + sb->block_size =4 ; + + c =cache_set_alloc (sb); +if (!c) +return -ENOMEM ; + +for (int i =0 ; i <3 ; i++) { +BUG_ON (list_empty (&c->btree_cache)); + all[i] = list_first_entry(&c->btree_cache, struct btree, list); +list_del_init (&all[i]->list); + + all[i]->key =KEY (0 ,0 , c->sb.bucket_size); +bkey_copy_key (&all[i]->key, &MAX_KEY ); + } + + b = all[0 ]; + fill = all[1 ]; + orig = all[2 ]; + +while (1 ) { +for (int i =0 ; i <3 ; i++) + all[i]->written = all[i]->nsets =0 ; + +bset_init_next (b); + +while (1 ) { +struct bset *i =write_block (b); +struct bkey *k = op.keys.top; + + k->key =get_random_int (); + + op.type = k->key &1 + ?BTREE_INSERT + :BTREE_REPLACE ; + k->key >>=1 ; + + k->header =KEY_HEADER (bucket_remainder (c, k->key),0 ); + k->key >>= c->bucket_bits; + k->key &=1024 *512 -1 ; + k->key += c->sb.bucket_size; +#if 0 +SET_KEY_PTRS (k,1 ); +#endif +keylist_push (&op.keys); +bcache_btree_insert_keys (b, &op); + +if (should_split (b) || +set_blocks (i, b->c) != +__set_blocks (i, i->keys +15 , b->c)) { + i->csum =csum_set (i); + +memcpy (write_block (fill), + i,set_bytes (i)); + + b->written +=set_blocks (i, b->c); + fill->written = b->written; +if (b->written ==btree_blocks (b)) +break ; + +btree_sort_lazy (b); +bset_init_next (b); + } + } + +memcpy (orig->sets[0 ].data, + fill->sets[0 ].data, +btree_bytes (c)); + +btree_sort (b); + fill->written =0 ; +btree_read_done (&fill->io.cl); + +if (b->sets[0 ].data->keys != fill->sets[0 ].data->keys || +memcmp (b->sets[0 ].data->start, + fill->sets[0 ].data->start, + b->sets[0 ].data->keys *sizeof (uint64_t ))) { +struct bset *i = b->sets[0 ].data; + +for (struct bkey *k = i->start, + *j = fill->sets[0 ].data->start; + k <end (i); + k =next (k), j =next (j)) +if (bkey_cmp (k, j) || +KEY_SIZE (k) !=KEY_SIZE (j)) +printk (KERN_ERR "key %zi differs: %s " +"!= %s\n" , (uint64_t *) k - i->d, +pkey (k),pkey (j)); + +for (int i =0 ; i <3 ; i++) { +printk (KERN_ERR "**** Set %i ****\n" , i); +dump (all[i]); + } +panic ("\n" ); + } + +printk (KERN_DEBUG "bcache: fuzz complete: %i keys\n" , + b->sets[0 ].data->keys); + } +} + +kobj_attribute_write (fuzz, btree_fuzz); +#endif + +#ifdef CONFIG_BCACHE_LATENCY_DEBUG +static ssize_t show (struct kobject *k,struct kobj_attribute *attr,char *buf) +{ +return snprintf (buf,PAGE_SIZE ,"%i\n" , latency_warn_ms); +} + +static ssize_t store (struct kobject *k,struct kobj_attribute *attr, +const char *buffer,size_t size) +{ +return strtoul_safe (buffer, latency_warn_ms) ?: (ssize_t ) size; +} + +kobj_attribute_rw (latency_warn_ms, show, store); +#endif + +void bcache_debug_exit (void ) +{ +if (!IS_ERR_OR_NULL (debug)) +debugfs_remove_recursive (debug); +} + +int __init bcache_debug_init (struct kobject *kobj) +{ +int ret =0 ; +#ifdef CONFIG_BCACHE_DEBUG + ret =sysfs_create_file (kobj, &ksysfs_fuzz.attr); +if (ret) +return ret; +#endif + +#ifdef CONFIG_BCACHE_LATENCY_DEBUG + ret =sysfs_create_file (kobj, &ksysfs_latency_warn_ms.attr); +if (ret) +return ret; +#endif + + debug =debugfs_create_dir ("bcache" ,NULL ); +return ret; +}
drivers/block/bcache/debug.h new file +53 -0
53 lines not on this page · raw message
drivers/block/bcache/trace.c new file +26 -0
@@ -0,0 +1,26 @@ +#include "bcache.h" +#include "btree.h" +#include "request.h" + +#include <linux/module.h> + +#define CREATE_TRACE_POINTS +#include <trace/events/bcache.h> + +EXPORT_TRACEPOINT_SYMBOL_GPL (bcache_request_start); +EXPORT_TRACEPOINT_SYMBOL_GPL (bcache_request_end); +EXPORT_TRACEPOINT_SYMBOL_GPL (bcache_passthrough); +EXPORT_TRACEPOINT_SYMBOL_GPL (bcache_cache_hit); +EXPORT_TRACEPOINT_SYMBOL_GPL (bcache_cache_miss); +EXPORT_TRACEPOINT_SYMBOL_GPL (bcache_read_retry); +EXPORT_TRACEPOINT_SYMBOL_GPL (bcache_writethrough); +EXPORT_TRACEPOINT_SYMBOL_GPL (bcache_writeback); +EXPORT_TRACEPOINT_SYMBOL_GPL (bcache_write_skip); +EXPORT_TRACEPOINT_SYMBOL_GPL (bcache_btree_read); +EXPORT_TRACEPOINT_SYMBOL_GPL (bcache_btree_write); +EXPORT_TRACEPOINT_SYMBOL_GPL (bcache_write_dirty); +EXPORT_TRACEPOINT_SYMBOL_GPL (bcache_read_dirty); +EXPORT_TRACEPOINT_SYMBOL_GPL (bcache_journal_write); +EXPORT_TRACEPOINT_SYMBOL_GPL (bcache_cache_insert); +EXPORT_TRACEPOINT_SYMBOL_GPL (bcache_gc_start); +EXPORT_TRACEPOINT_SYMBOL_GPL (bcache_gc_end);
Signature · 1 line
1.7.9.rc2
Quoted 7 lines · Kent Overstreet
bcache: a cache for arbitrary block devices using an SSD.
Short overview:
Bcache does both writethrough and writeback caching. It presents itself as a new block device, a bit like say md. You can cache an arbitrary number of block devices with a single cache device, and attach and detach things at runtime - it's quite flexible.
So it is still not a device mapper target. I somehow had the impression that consensus at LSF was to convert it into a device mapper target.
Thanks
Vivek
On Wed, May 09, 2012 at 11:07:29PM -0400, Kent Overstreet wrote:
[..]
Quoted 5 lines
The userspace interface is going to change before it goes in. The general consensus at LSF was that we don't want yet another interface for probing/managing block devices, and dm exists so we may as well use that. I don't think anyone's started on that yet, though.
Ok, I missed above lines and was pointed to it. So idea of this posting is to review core changes and then somebody else needs to take the core, wrap it with dm apis and repost?
Thanks
Vivek
Quoted 9 lines · Vivek Goyal
On Wed, May 09, 2012 at 11:07:29PM -0400, Kent Overstreet wrote:
[..]
Quoted 5 lines
The userspace interface is going to change before it goes in. The general consensus at LSF was that we don't want yet another interface for probing/managing block devices, and dm exists so we may as well use that. I don't think anyone's started on that yet, though.
Quoted 3 lines
Ok, I missed above lines and was pointed to it. So idea of this posting is to review core changes and then somebody else needs to take the core, wrap it with dm apis and repost?
More or less - I'm not sure who's going to be doing the dm integration work (I honestly don't have time), but it's not been forgotten. But there's other stuff that needs review in the meantime.
Quoted 23 lines · Kent Overstreet
bcache: a cache for arbitrary block devices using an SSD.
Short overview:
Bcache does both writethrough and writeback caching. It presents itself as a new block device, a bit like say md. You can cache an arbitrary number of block devices with a single cache device, and attach and detach things at runtime - it's quite flexible.It's very fast. It uses a b+ tree for the index, along with a journal to coalesce index updates, and a bunch of other cool tricks like auxiliary binary search trees with software floating point keys for searching within btree nodes.
Bcache is solid, production ready code. There are still bugs being found that affect specific configurations, but there haven't been any major issues found in awhile - it's well past time I started working on getting it into mainline.
It's a lot of code - I tried to split it out so that it'd make some sort of sense for reviewing. Let me know if there's anything else I can do to make review easier.
TODO/known issues:
Quoted 8 lines
__up_write()needs to be exported for bcache to compile as a module - it's used for bypassing lockdep when traversing the btree during garbage collection. If someone else knows a better solution, please let me know.The userspace interface is going to change before it goes in. The general consensus at LSF was that we don't want yet another interface for probing/managing block devices, and dm exists so we may as well use that. I don't think anyone's started on that yet, though.
Might as well mention I've started work on a md conversion. Nearing the point of having RFC patches ready to post.
I'm doing it in such a way that it does not preclude a dm target from coming along as well. Like I mentioned to Alasdair at LSF, there's no reason this could not be treated the same as the shared raid personalities between dm and md.
--
Dan
A message that is not in the archive (sent off-list or not yet received): 1188908028.170.1336674698865.JavaMail.mail@webmail09
Re: [Bcache v13 11/16] bcache: Core btree code
Quoted 1 line · Kent Overstreet
Signed-off-by Kent Overstreet <[email protected]>
[]
Review
Quoted 3 lines
(quoted diff) +3
-0+ +void btree_read_done(struct closure *cl) +{
[]
Review
Quoted 9 lines
(quoted diff) +9
-0+ if (b->written < btree_blocks(b)) + bset_init_next(b); + + if (0) { +err: set_btree_node_io_error(b); + cache_set_error(b->c, "%s at bucket %lu, block %zu, %u keys", + err, PTR_BUCKET_NR(b->c, &b->key, 0), + index(i, b), i->keys); + }
Hi Kent
trivia: This if (0) is an exceedingly ugly style.
I'd much prefer:
if (foo) bar(); goto exit;
err:
set_btree_node_io_error(b); cache_set_error(b->c, "%s at bucket %lu, block %zu, %u keys", err, PTR_BUCKET_NR(b->c, &b->key, 0), index(i, b), i->keys);
exit:
etc...
Re: [Bcache v13 11/16] bcache: Core btree code
I don't feel strongly one way or the other about it, but I do think it's more just a matter of taste - the if (0) is ugly, I'll certainly grant you that but IMO it makes the weird control flow harder to miss, and the indentation more or less matches the control flow.
But I haven't come up with a way of writing that I actually like, I dislike them all almost equally.
Quoted 38 lines · Joe Perches
Quoted 1 line · Kent Overstreet
Signed-off-by Kent Overstreet <[email protected]>[]
Review
Quoted 3 lines
(quoted diff) +3
-0+ +void btree_read_done(struct closure *cl) +{[]
Review
Quoted 9 lines
+ if (
b->written<btree_blocks(b))
+bset_init_next(b);(quoted diff) +7
-0+ + if (0) { +err: set_btree_node_io_error(b); + cache_set_error(b->c, "%s at bucket %lu, block %zu, %u keys", + err, PTR_BUCKET_NR(b->c, &b->key, 0), + index(i, b), i->keys); + }Hi Kent
trivia: This if (0) is an exceedingly ugly style.
I'd much prefer:
if (foo)
bar();goto exit;
err:
set_btree_node_io_error(b);
cache_set_error(b->c, "%s at bucket %lu, block %zu, %u keys", err,PTR_BUCKET_NR(b->c, &b->key, 0),index(i, b),i->keys);exit:
etc...
Quoted 6 lines · Kent Overstreet
TODO/known issues:
__up_write()needs to be exported for bcache to compile as a module - it's used for bypassing lockdep when traversing the btree during garbage collection. If someone else knows a better solution, please let me know.
Quoted 6 lines
The userspace interface is going to change before it goes in. The general consensus at LSF was that we don't want yet another interface for probing/managing block devices, and dm exists so we may as well use that. I don't think anyone's started on that yet, though.
Documentation needs to be updated. That's being actively worked on, though.
Hi Kent,
Sorry for jumping in late in the discussion. I believe we discussed the requirements for the low-end media when you posted v12 and it seemed that there are issues with a lot of the low-end media you were planning to support. I have seen devices with 12MB or 16MB erase block size, which you didn't handle well, and many devices are severely limited on the number of buckets (erase blocks that a device can write to concurrently), typically 3 to 8 for an SD card and slightly more for a USB drive.
Are you still planning to support those devices or are you focusing now on other hardware? If you plan to support them, what are you current limits on the bucket size and the number of buckets?
FWIW, Tixy has written a tool named flashsim[1] to simulate the behavior of all kinds of flash drives, so you can use a blocktrace file as input and it will tell you the write amplification factor that a given drive would suffer given that workload. You can use it to find out how your algorithms would interact with devices that can only support a smaller number of buckets that you would actually want.
Arnd
Hello, Kent.
Here are my additional impressions after trying to read a bit more from make_request.
* Single char variable names suck. It's difficult to tell what type they are, what they're used for and makes it difficult to track where the variable is used in the function - try to highlight the variable name in the editor.
While not a strict rule, there are reasons why people tend to use single char variable names mostly for specific things - e.g. loop variables, transient integral variables or in numerical context. They're either localized to small scope of code so keeping track of them is easy and/or people are familiar with such usages.
So, I would *much* prefer if I don't have to keep trying to track what the hell c, d, k, j, l mean and where they're used.
* Due to the various style issues, lack of documentation and other abundant idiosyncrasies in the code, at least I find the code almost aggravating. It's complicated, difficult to read and full of unnecessary differences and smart tricks (smart is not a positive word here). I don't think we want code like this in the kernel. Hell, I would get pretty upset if I encounter this type of code while trying to update some block API.
* Maybe I haven't seen enough of it but my feeling about closure hasn't gone up. It likely has gone further down. It doesn't actually seem to solve the pain points of async programming while adding ample headaches. The usages that I followed could be easily served by either domain-specific async sequencer or the existing ref / async / whatever mechanism / convention. If you have good example usage in bcache, please feel free to explain it.
So, I don't know. If this is a driver for some super obscure device that would fall out of use in some years and doesn't interact with / affect the rest of the kernel, maybe we can put it in with big giant blinking red warnings about the dragons inside, but as it currently stands I don't think I can ack the code base and am afraid that it would need non-trivial updates to be upstreamable.
I'm gonna stop reading and, for now
Thanks.
Signature · 1 line
tejun
Quoted 13 lines · Kent Overstreet
bcache: a cache for arbitrary block devices using an SSD.
Short overview:
Bcache does both writethrough and writeback caching. It presents itself as a new block device, a bit like say md. You can cache an arbitrary number of block devices with a single cache device, and attach and detach things at runtime - it's quite flexible.It's very fast. It uses a b+ tree for the index, along with a journal to coalesce index updates, and a bunch of other cool tricks like auxiliary binary search trees with software floating point keys for searching within btree nodes.
Quoted 6 lines
Bcache is solid, production ready code. There are still bugs being found that affect specific configurations, but there haven't been any major issues found in awhile - it's well past time I started working on getting it into mainline.
It's a lot of code - I tried to split it out so that it'd make some sort of sense for reviewing. Let me know if there's anything else I can do to make
This feature is so interesting; Do you have one clean public git tree about this patchset? So that i can pull it to play with it.
Quoted 121 lines
review easier.
TODO/known issues:
__up_write()needs to be exported for bcache to compile as a module - it's used for bypassing lockdep when traversing the btree during garbage collection. If someone else knows a better solution, please let me know.The userspace interface is going to change before it goes in. The general consensus at LSF was that we don't want yet another interface for probing/managing block devices, and dm exists so we may as well use that. I don't think anyone's started on that yet, though.
Documentation needs to be updated. That's being actively worked on, though.
Kent Overstreet (16):
Only clone bio vecs that are in use
Bio pool freeing
Revert "rw_semaphore: remove up/down_read_non_owner" Fix ratelimit macro to compile in c99 mode Exportget_random_int()
Exportblk_fill_rwbs()
Closures
bcache: Documentation, and changes to generic code
Bcache: generic utility code
bcache: Superblock/initialization/sysfs code
bcache: Core btree code
bcache: Bset code (lookups within a btree node)
bcache: Journalling
bcache: Request, io and allocation code
bcache: Writeback
bcache: Debug and tracing codeDocumentation/ABI/testing/sysfs-block-bcache | 156 ++
Documentation/bcache.txt| 255 +++block/blk-core.c| 2 +-drivers/block/Kconfig| 2 +drivers/block/Makefile| 1 +drivers/block/bcache/Kconfig | 42 + drivers/block/bcache/Makefile | 8 + drivers/block/bcache/alloc.c | 591 +++++++ drivers/block/bcache/bcache.h | 839 ++++++++++ drivers/block/bcache/bset.c | 1149 +++++++++++++ drivers/block/bcache/bset.h | 218 +++ drivers/block/bcache/btree.c | 2249 ++++++++++++++++++++++++++ drivers/block/bcache/btree.h | 272 ++++ drivers/block/bcache/debug.c | 574 +++++++ drivers/block/bcache/debug.h | 53 + drivers/block/bcache/io.c | 198 +++ drivers/block/bcache/journal.c | 722 +++++++++ drivers/block/bcache/journal.h | 113 ++ drivers/block/bcache/request.c | 1470 +++++++++++++++++ drivers/block/bcache/request.h | 58 + drivers/block/bcache/stats.c | 243 +++ drivers/block/bcache/stats.h | 58 + drivers/block/bcache/super.c | 2000 +++++++++++++++++++++++ drivers/block/bcache/sysfs.c | 802 +++++++++ drivers/block/bcache/sysfs.h | 99 ++ drivers/block/bcache/trace.c | 26 +drivers/block/bcache/util.c | 572 +++++++
drivers/block/bcache/util.h| 657 ++++++++drivers/block/bcache/writeback.c| 518 ++++++drivers/block/rbd.c| 2 +-drivers/char/random.c| 1 +drivers/md/dm.c| 27 +-drivers/md/md.c| 3 +-fs/bio.c| 55 +-include/linux/bio.h| 7 +-include/linux/blk_types.h| 2 +include/linux/cgroup_subsys.h| 6 +include/linux/closure.h| 614 +++++++include/linux/ratelimit.h| 2 +-include/linux/rwsem.h| 10 +include/linux/sched.h| 4 +include/trace/events/bcache.h| 257 +++kernel/fork.c| 4 +kernel/rwsem.c| 16 +kernel/trace/blktrace.c| 1 + lib/Kconfig | 3 +lib/Kconfig.debug| 9 + lib/Makefile | 2 +lib/closure.c| 363 +++++49 files changed, 15288 insertions(+), 47 deletions(-)create mode 100644
Documentation/ABI/testing/sysfs-block-bcachecreate mode 100644Documentation/bcache.txt
create mode 100644drivers/block/bcache/Kconfigcreate mode 100644drivers/block/bcache/Makefilecreate mode 100644drivers/block/bcache/alloc.ccreate mode 100644drivers/block/bcache/bcache.hcreate mode 100644drivers/block/bcache/bset.c
create mode 100644drivers/block/bcache/bset.h
create mode 100644drivers/block/bcache/btree.ccreate mode 100644drivers/block/bcache/btree.hcreate mode 100644drivers/block/bcache/debug.ccreate mode 100644drivers/block/bcache/debug.hcreate mode 100644drivers/block/bcache/io.c
create mode 100644drivers/block/bcache/journal.ccreate mode 100644drivers/block/bcache/journal.hcreate mode 100644drivers/block/bcache/request.ccreate mode 100644drivers/block/bcache/request.hcreate mode 100644drivers/block/bcache/stats.ccreate mode 100644drivers/block/bcache/stats.hcreate mode 100644drivers/block/bcache/super.ccreate mode 100644drivers/block/bcache/sysfs.ccreate mode 100644drivers/block/bcache/sysfs.hcreate mode 100644drivers/block/bcache/trace.ccreate mode 100644drivers/block/bcache/util.c
create mode 100644drivers/block/bcache/util.h
create mode 100644drivers/block/bcache/writeback.ccreate mode 100644include/linux/closure.h
create mode 100644include/trace/events/bcache.hcreate mode 100644lib/closure.c--
1.7.9.rc2--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Signature · 3 lines
Regards, Zhi Yong Wu