summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5-cache.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2015-12-21 00:51:01 +0100
committerNeilBrown <neilb@suse.com>2016-01-06 01:39:43 +0100
commitad66d445ee5a5f548142b880e1642c711fbcacd1 (patch)
tree517796bd27c55de0e18b3a52257af4e401fed281 /drivers/md/raid5-cache.c
parentraid5-cache: simplify r5l_move_io_unit_list (diff)
downloadlinux-ad66d445ee5a5f548142b880e1642c711fbcacd1.tar.xz
linux-ad66d445ee5a5f548142b880e1642c711fbcacd1.zip
raid5-cache: free meta_page earlier
Once the I/O completed we don't need the meta page anymore. As the iounits can live on for a long time this reduces memory pressure a bit. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Shaohua Li <shli@fb.com> Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'drivers/md/raid5-cache.c')
-rw-r--r--drivers/md/raid5-cache.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c
index 3699c4704ba8..668e973f07e6 100644
--- a/drivers/md/raid5-cache.c
+++ b/drivers/md/raid5-cache.c
@@ -150,12 +150,6 @@ static bool r5l_has_free_space(struct r5l_log *log, sector_t size)
return log->device_size > used_size + size;
}
-static void r5l_free_io_unit(struct r5l_log *log, struct r5l_io_unit *io)
-{
- __free_page(io->meta_page);
- kmem_cache_free(log->io_kc, io);
-}
-
static void __r5l_set_io_unit_state(struct r5l_io_unit *io,
enum r5l_io_unit_state state)
{
@@ -215,6 +209,7 @@ static void r5l_log_endio(struct bio *bio)
md_error(log->rdev->mddev, log->rdev);
bio_put(bio);
+ __free_page(io->meta_page);
spin_lock_irqsave(&log->io_list_lock, flags);
__r5l_set_io_unit_state(io, IO_UNIT_IO_END);
@@ -552,7 +547,7 @@ static bool r5l_complete_finished_ios(struct r5l_log *log)
log->next_cp_seq = io->seq;
list_del(&io->log_sibling);
- r5l_free_io_unit(log, io);
+ kmem_cache_free(log->io_kc, io);
found = true;
}