[PATCH] dm-bufio: set last_accessed when relinking the buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

Here I'm sending the patch for dm-bufio last_accessed. (bug 1145230)

BTW. do you think that we also need to increase default max_age value (60 
seconds)? What do you think the default value should be?

Mikulas


From: Mikulas Patocka <mpatocka@xxxxxxxxxx>

The variable last_accessed was set only once when the buffer was created.
In the result, the buffer was discarded after dm_bufio_max_age, even if it
was used recently.

This patch changes it so that last_accessed is set each time the buffer is
moved to the head of the LRU list, so the buffer is discarded if it was
not used in dm_bufio_max_age time.

Signed-off-by: Mikulas Patocka <mpatocka@xxxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx	# v3.2+

---
 drivers/md/dm-bufio.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-3.17-rc7/drivers/md/dm-bufio.c
===================================================================
--- linux-3.17-rc7.orig/drivers/md/dm-bufio.c	2014-09-30 17:41:31.000000000 +0200
+++ linux-3.17-rc7/drivers/md/dm-bufio.c	2014-09-30 17:41:57.000000000 +0200
@@ -465,6 +465,7 @@ static void __relink_lru(struct dm_buffe
 	c->n_buffers[dirty]++;
 	b->list_mode = dirty;
 	list_move(&b->lru_list, &c->lru[dirty]);
+	b->last_accessed = jiffies;
 }
 
 /*----------------------------------------------------------------

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux