summaryrefslogtreecommitdiff
path: root/drivers/md/bcache/request.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/request.c
parentb0f32a56f27eb0df4124dbfc8eb6f09f423eed99 (diff)
downloadlwn-d56d000a1f424aa77538bd5aad18b43037ed20cc.tar.gz
lwn-d56d000a1f424aa77538bd5aad18b43037ed20cc.zip
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/request.c')
-rw-r--r--drivers/md/bcache/request.c3
1 files changed, 2 insertions, 1 deletions
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)
if (error)
s->iop.error = error;
- else if (ptr_stale(s->iop.c, &b->key, 0)) {
+ else if (!KEY_DIRTY(&b->key) &&
+ ptr_stale(s->iop.c, &b->key, 0)) {
atomic_long_inc(&s->iop.c->cache_read_races);
s->iop.error = -EINTR;
}