aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-08-10 00:14:13 -0400
committerKent Overstreet <kmo@daterainc.com>2014-01-08 16:05:07 -0500
commitd56d000a1f424aa77538bd5aad18b43037ed20cc (patch)
tree77a303f11e2462546f0e621fa9a5a4d840d23dba /drivers/md
parentb0f32a56f27eb0df4124dbfc8eb6f09f423eed99 (diff)
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')
-rw-r--r--drivers/md/bcache/bset.c6
-rw-r--r--drivers/md/bcache/request.c3
2 files changed, 7 insertions, 2 deletions
diff --git a/drivers/md/bcache/bset.c b/drivers/md/bcache/bset.c
index 16958704af3b..e51a739f7514 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)
176 bch_ptr_invalid(b, k)) 176 bch_ptr_invalid(b, k))
177 return true; 177 return true;
178 178
179 for (i = 0; i < KEY_PTRS(k); i++) { 179 for (i = 0; i < KEY_PTRS(k); i++)
180 if (!ptr_available(b->c, k, i)) 180 if (!ptr_available(b->c, k, i))
181 return true; 181 return true;
182 182
183 if (!expensive_debug_checks(b->c) && KEY_DIRTY(k))
184 return false;
185
186 for (i = 0; i < KEY_PTRS(k); i++) {
183 g = PTR_BUCKET(b->c, k, i); 187 g = PTR_BUCKET(b->c, k, i);
184 stale = ptr_stale(b->c, k, i); 188 stale = ptr_stale(b->c, k, i);
185 189
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index 5878cdb39529..59b3d6df100b 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -630,7 +630,8 @@ static void bch_cache_read_endio(struct bio *bio, int error)
630 630
631 if (error) 631 if (error)
632 s->iop.error = error; 632 s->iop.error = error;
633 else if (ptr_stale(s->iop.c, &b->key, 0)) { 633 else if (!KEY_DIRTY(&b->key) &&
634 ptr_stale(s->iop.c, &b->key, 0)) {
634 atomic_long_inc(&s->iop.c->cache_read_races); 635 atomic_long_inc(&s->iop.c->cache_read_races);
635 s->iop.error = -EINTR; 636 s->iop.error = -EINTR;
636 } 637 }