Re: [PATCH] Prevent large file writeback starvation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux