Skip to content

Commit

Permalink
Merge branch 'bcache-for-upstream' of git://evilpiepirate.org/~kent/l…
Browse files Browse the repository at this point in the history
…inux-bcache into for-linus

Kent writes:

Jens - couple more bcache patches. Bug fixes and a doc update.
  • Loading branch information
Jens Axboe committed May 15, 2013
2 parents 093c959 + f59fce8 commit c0a363f
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 127 deletions.
12 changes: 9 additions & 3 deletions Documentation/bcache.txt
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,10 @@ cache<0..n>
Symlink to each of the cache devices comprising this cache set.

cache_available_percent
Percentage of cache device free.
Percentage of cache device which doesn't contain dirty data, and could
potentially be used for writeback. This doesn't mean this space isn't used
for clean cached data; the unused statistic (in priority_stats) is typically
much lower.

clear_stats
Clears the statistics associated with this cache
Expand Down Expand Up @@ -423,8 +426,11 @@ nbuckets
Total buckets in this cache

priority_stats
Statistics about how recently data in the cache has been accessed. This can
reveal your working set size.
Statistics about how recently data in the cache has been accessed.
This can reveal your working set size. Unused is the percentage of
the cache that doesn't contain any data. Metadata is bcache's
metadata overhead. Average is the average priority of cache buckets.
Next is a list of quantiles with the priority threshold of each.

written
Sum of all data that has been written to the cache; comparison with
Expand Down
1 change: 0 additions & 1 deletion drivers/md/bcache/Kconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

config BCACHE
tristate "Block device as cache"
select CLOSURES
---help---
Allows a block device to be used as cache for other devices; uses
a btree for indexing and the layout is optimized for SSDs.
Expand Down
2 changes: 1 addition & 1 deletion drivers/md/bcache/bcache.h
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ void bch_cache_set_stop(struct cache_set *);
struct cache_set *bch_cache_set_alloc(struct cache_sb *);
void bch_btree_cache_free(struct cache_set *);
int bch_btree_cache_alloc(struct cache_set *);
void bch_writeback_init_cached_dev(struct cached_dev *);
void bch_cached_dev_writeback_init(struct cached_dev *);
void bch_moving_init_cache_set(struct cache_set *);

void bch_cache_allocator_exit(struct cache *ca);
Expand Down
34 changes: 16 additions & 18 deletions drivers/md/bcache/stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,6 @@ static struct attribute *bch_stats_files[] = {
};
static KTYPE(bch_stats);

static void scale_accounting(unsigned long data);

void bch_cache_accounting_init(struct cache_accounting *acc,
struct closure *parent)
{
kobject_init(&acc->total.kobj, &bch_stats_ktype);
kobject_init(&acc->five_minute.kobj, &bch_stats_ktype);
kobject_init(&acc->hour.kobj, &bch_stats_ktype);
kobject_init(&acc->day.kobj, &bch_stats_ktype);

closure_init(&acc->cl, parent);
init_timer(&acc->timer);
acc->timer.expires = jiffies + accounting_delay;
acc->timer.data = (unsigned long) acc;
acc->timer.function = scale_accounting;
add_timer(&acc->timer);
}

int bch_cache_accounting_add_kobjs(struct cache_accounting *acc,
struct kobject *parent)
{
Expand Down Expand Up @@ -244,3 +226,19 @@ void bch_mark_sectors_bypassed(struct search *s, int sectors)
atomic_add(sectors, &dc->accounting.collector.sectors_bypassed);
atomic_add(sectors, &s->op.c->accounting.collector.sectors_bypassed);
}

void bch_cache_accounting_init(struct cache_accounting *acc,
struct closure *parent)
{
kobject_init(&acc->total.kobj, &bch_stats_ktype);
kobject_init(&acc->five_minute.kobj, &bch_stats_ktype);
kobject_init(&acc->hour.kobj, &bch_stats_ktype);
kobject_init(&acc->day.kobj, &bch_stats_ktype);

closure_init(&acc->cl, parent);
init_timer(&acc->timer);
acc->timer.expires = jiffies + accounting_delay;
acc->timer.data = (unsigned long) acc;
acc->timer.function = scale_accounting;
add_timer(&acc->timer);
}
Loading

0 comments on commit c0a363f

Please sign in to comment.