Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Christoph Hellwig and committed by
NeilBrown
ad66d445 3848c0bc

+2 -7
+2 -7
drivers/md/raid5-cache.c
··· 150 150 return log->device_size > used_size + size; 151 151 } 152 152 153 - static void r5l_free_io_unit(struct r5l_log *log, struct r5l_io_unit *io) 154 - { 155 - __free_page(io->meta_page); 156 - kmem_cache_free(log->io_kc, io); 157 - } 158 - 159 153 static void __r5l_set_io_unit_state(struct r5l_io_unit *io, 160 154 enum r5l_io_unit_state state) 161 155 { ··· 209 215 md_error(log->rdev->mddev, log->rdev); 210 216 211 217 bio_put(bio); 218 + __free_page(io->meta_page); 212 219 213 220 spin_lock_irqsave(&log->io_list_lock, flags); 214 221 __r5l_set_io_unit_state(io, IO_UNIT_IO_END); ··· 547 552 log->next_cp_seq = io->seq; 548 553 549 554 list_del(&io->log_sibling); 550 - r5l_free_io_unit(log, io); 555 + kmem_cache_free(log->io_kc, io); 551 556 552 557 found = true; 553 558 }