Messages in this thread | | | Date | Tue, 7 Feb 2006 18:49:14 +1100 | From | David Chinner <> | Subject | Re: [PATCH] Prevent large file writeback starvation |
| |
On Mon, Feb 06, 2006 at 03:14:35PM -0800, Andrew Morton wrote: > > So to fix both these problems we need to be smarter about terminating the > wb_kupdate() loop. Something like "loop until no expired inodes have been > written". > > Wildly untested patch:
> wbc.nr_to_write = MAX_WRITEBACK_PAGES; > + wbc.wrote_expired_inode = 0; > writeback_inodes(&wbc); > - if (wbc.nr_to_write > 0) { > + if (wbc.wrote_expired_inode == 0) { > if (wbc.encountered_congestion) > blk_congestion_wait(WRITE, HZ/10); > else
FWIW, Theres a problem with the logic here - if we've encountered congestion, we want to wait even if we wrote back expired inodes. Should it be:
if (!wbc.wrote_expired_inode && !wbc.encountered_congestion) break; /* All the old data is written */ if (wbc.encountered_congestion) blk_congestion_wait(WRITE, HZ/10);
Cheers,
Dave. -- Dave Chinner R&D Software Enginner SGI Australian Software Group - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |