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.

gfs2: less aggressive low-memory log flushing

It turns out that for some workloads, the fix in commit b74cd55aa9a9d
("gfs2: low-memory forced flush fixes") causes the number of forced log
flushes to increase to a degree that the overall filesystem performance
drops significantly. Address that by forcing a log flush only when
gfs2_writepages cannot make any progress rather than when it cannot make
"enough" progress.

Fixes: b74cd55aa9a9d ("gfs2: low-memory forced flush fixes")
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>

+3 -2
+3 -2
fs/gfs2/aops.c
··· 158 158 struct writeback_control *wbc) 159 159 { 160 160 struct gfs2_sbd *sdp = gfs2_mapping2sbd(mapping); 161 + long initial_nr_to_write = wbc->nr_to_write; 161 162 struct iomap_writepage_ctx wpc = { 162 163 .inode = mapping->host, 163 164 .wbc = wbc, ··· 167 166 int ret; 168 167 169 168 /* 170 - * Even if we didn't write enough pages here, we might still be holding 169 + * Even if we didn't write any pages here, we might still be holding 171 170 * dirty pages in the ail. We forcibly flush the ail because we don't 172 171 * want balance_dirty_pages() to loop indefinitely trying to write out 173 172 * pages held in the ail that it can't find. 174 173 */ 175 174 ret = iomap_writepages(&wpc); 176 - if (ret == 0 && wbc->nr_to_write > 0) 175 + if (ret == 0 && wbc->nr_to_write == initial_nr_to_write) 177 176 set_bit(SDF_FORCE_AIL_FLUSH, &sdp->sd_flags); 178 177 return ret; 179 178 }