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

Configure Feed

Select the types of activity you want to include in your feed.

fuse: use default writeback accounting

commit 0c58a97f919c ("fuse: remove tmp folio for writebacks and internal
rb tree") removed temp folios for dirty page writeback. Consequently,
fuse can now use the default writeback accounting.

With switching fuse to use default writeback accounting, there are some
added benefits. This updates wb->writeback_inodes tracking as well now
and updates writeback throughput estimates after writeback completion.

This commit also removes inc_wb_stat() and dec_wb_stat(). These have no
callers anymore now that fuse does not call them.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Bernd Schubert <bschubert@ddn.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>

authored by

Joanne Koong and committed by
Miklos Szeredi
494d2f50 b4da63ce

+1 -20
+1 -8
fs/fuse/file.c
··· 1822 1822 struct fuse_args_pages *ap = &wpa->ia.ap; 1823 1823 struct inode *inode = wpa->inode; 1824 1824 struct fuse_inode *fi = get_fuse_inode(inode); 1825 - struct backing_dev_info *bdi = inode_to_bdi(inode); 1826 1825 int i; 1827 1826 1828 - for (i = 0; i < ap->num_folios; i++) { 1827 + for (i = 0; i < ap->num_folios; i++) 1829 1828 /* 1830 1829 * Benchmarks showed that ending writeback within the 1831 1830 * scope of the fi->lock alleviates xarray lock 1832 1831 * contention and noticeably improves performance. 1833 1832 */ 1834 1833 iomap_finish_folio_write(inode, ap->folios[i], 1); 1835 - dec_wb_stat(&bdi->wb, WB_WRITEBACK); 1836 - wb_writeout_inc(&bdi->wb); 1837 - } 1838 1834 1839 1835 wake_up(&fi->page_waitq); 1840 1836 } ··· 2005 2009 static void fuse_writepage_args_page_fill(struct fuse_writepage_args *wpa, struct folio *folio, 2006 2010 uint32_t folio_index, loff_t offset, unsigned len) 2007 2011 { 2008 - struct inode *inode = folio->mapping->host; 2009 2012 struct fuse_args_pages *ap = &wpa->ia.ap; 2010 2013 2011 2014 ap->folios[folio_index] = folio; 2012 2015 ap->descs[folio_index].offset = offset; 2013 2016 ap->descs[folio_index].length = len; 2014 - 2015 - inc_wb_stat(&inode_to_bdi(inode)->wb, WB_WRITEBACK); 2016 2017 } 2017 2018 2018 2019 static struct fuse_writepage_args *fuse_writepage_args_setup(struct folio *folio,
-2
fs/fuse/inode.c
··· 1561 1561 if (err) 1562 1562 return err; 1563 1563 1564 - /* fuse does it's own writeback accounting */ 1565 - sb->s_bdi->capabilities &= ~BDI_CAP_WRITEBACK_ACCT; 1566 1564 sb->s_bdi->capabilities |= BDI_CAP_STRICTLIMIT; 1567 1565 1568 1566 /*
-10
include/linux/backing-dev.h
··· 66 66 percpu_counter_add_batch(&wb->stat[item], amount, WB_STAT_BATCH); 67 67 } 68 68 69 - static inline void inc_wb_stat(struct bdi_writeback *wb, enum wb_stat_item item) 70 - { 71 - wb_stat_mod(wb, item, 1); 72 - } 73 - 74 - static inline void dec_wb_stat(struct bdi_writeback *wb, enum wb_stat_item item) 75 - { 76 - wb_stat_mod(wb, item, -1); 77 - } 78 - 79 69 static inline s64 wb_stat(struct bdi_writeback *wb, enum wb_stat_item item) 80 70 { 81 71 return percpu_counter_read_positive(&wb->stat[item]);