summaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/bset.c
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-08-09 21:14:13 -0700
committerKent Overstreet <kmo@daterainc.com>2014-01-08 13:05:07 -0800
commitd56d000a1f424aa77538bd5aad18b43037ed20cc (patch)
tree77a303f11e2462546f0e621fa9a5a4d840d23dba /drivers/md/bcache/bset.c
parentb0f32a56f27eb0df4124dbfc8eb6f09f423eed99 (diff)
downloadop-kernel-dev-d56d000a1f424aa77538bd5aad18b43037ed20cc.zip
op-kernel-dev-d56d000a1f424aa77538bd5aad18b43037ed20cc.tar.gz
bcache: Don't touch bucket gen for dirty ptrs
Unnecessary since a bucket that has dirty pointers pointing to it can never be invalidated - and skipping it is a measurable performance boost, since the bucket gen will usually be a cache miss. Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/bset.c')
-rw-r--r--drivers/md/bcache/bset.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/md/bcache/bset.c b/drivers/md/bcache/bset.c
index 1695870..e51a739 100644
--- a/drivers/md/bcache/bset.c
+++ b/drivers/md/bcache/bset.c
@@ -176,10 +176,14 @@ bool bch_ptr_bad(struct btree *b, const struct bkey *k)
bch_ptr_invalid(b, k))
return true;
- for (i = 0; i < KEY_PTRS(k); i++) {
+ for (i = 0; i < KEY_PTRS(k); i++)
if (!ptr_available(b->c, k, i))
return true;
+ if (!expensive_debug_checks(b->c) && KEY_DIRTY(k))
+ return false;
+
+ for (i = 0; i < KEY_PTRS(k); i++) {
g = PTR_BUCKET(b->c, k, i);
stale = ptr_stale(b->c, k, i);
OpenPOWER on IntegriCloud