summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2014-09-30 09:32:46 +0100
committerMike Snitzer <snitzer@redhat.com>2014-10-05 20:03:37 -0400
commiteb76faf53b1ff7a77ce3f78cc98ad392ac70c2a0 (patch)
tree193ccb7f0b8f9e098a659ccecb1d1b2f9244441c /drivers/md
parent48cf06bc5f508d5f71bc0fd7530daebb12a48428 (diff)
downloadlinux-eb76faf53b1ff7a77ce3f78cc98ad392ac70c2a0.tar.gz
linux-eb76faf53b1ff7a77ce3f78cc98ad392ac70c2a0.tar.bz2
linux-eb76faf53b1ff7a77ce3f78cc98ad392ac70c2a0.zip
dm bufio: update last_accessed when relinking a buffer
The 'last_accessed' member of the dm_buffer structure was only set when the the buffer was created. This led to each buffer being discarded after dm_bufio_max_age time even if it was used recently. In practice this resulted in all thinp metadata being evicted soon after being read -- this is particularly problematic for metadata intensive workloads like multithreaded small random IO. 'last_accessed' is now updated each time the buffer is moved to the head of the LRU list, so the buffer is now properly discarded if it was not used in dm_bufio_max_age time. Signed-off-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Cc: stable@vger.kernel.org # v3.2+
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-bufio.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index ab472c557d18..eab64bcaab66 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -465,6 +465,7 @@ static void __relink_lru(struct dm_buffer *b, int dirty)
c->n_buffers[dirty]++;
b->list_mode = dirty;
list_move(&b->lru_list, &c->lru[dirty]);
+ b->last_accessed = jiffies;
}
/*----------------------------------------------------------------