Index: linux-2.6/fs/xfs/linux-2.6/xfs_aops.c =================================================================== --- linux-2.6.orig/fs/xfs/linux-2.6/xfs_aops.c 2009-08-26 20:04:34.493855656 -0300 +++ linux-2.6/fs/xfs/linux-2.6/xfs_aops.c 2009-08-26 20:06:07.105357325 -0300 @@ -691,7 +691,7 @@ xfs_probe_cluster( tindex = startpage->index + 1; /* Prune this back to avoid pathological behavior */ - tloff = min(tlast, startpage->index + 64); + tloff = min(tlast, startpage->index + 8192); pagevec_init(&pvec, 0); while (!done && tindex <= tloff) { @@ -883,21 +883,8 @@ xfs_convert_page( if (uptodate && bh == head) SetPageUptodate(page); - if (startio) { - if (count) { - struct backing_dev_info *bdi; - - bdi = inode->i_mapping->backing_dev_info; - wbc->nr_to_write--; - if (bdi_write_congested(bdi)) { - wbc->encountered_congestion = 1; - done = 1; - } else if (wbc->nr_to_write <= 0) { - done = 1; - } - } + if (startio) xfs_start_page_writeback(page, !page_dirty, count); - } return done; fail_unlock_page: @@ -1181,6 +1168,8 @@ xfs_page_state_convert( if (iohead) xfs_submit_ioend(iohead); + if (wbc->nr_to_write < 1) + wbc->nr_to_write = 1; return page_dirty; error: @@ -1197,6 +1186,8 @@ error: block_invalidatepage(page, 0); ClearPageUptodate(page); } + if (wbc->nr_to_write < 1) + wbc->nr_to_write = 1; return err; } @@ -1266,14 +1257,6 @@ xfs_vm_writepage( if (!page_has_buffers(page)) create_empty_buffers(page, 1 << inode->i_blkbits, 0); - - /* - * VM calculation for nr_to_write seems off. Bump it way - * up, this gets simple streaming writes zippy again. - * To be reviewed again after Jens' writeback changes. - */ - wbc->nr_to_write *= 4; - /* * Convert delayed allocate, unwritten or unmapped space * to real space and flush out to disk.