Re: [PATCH 1/2] writeback: Improve busyloop prevention

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

 



> From 7b559f1cea41cdba7b39138ad1637f8000e218b9 Mon Sep 17 00:00:00 2001
> From: Jan Kara <jack@xxxxxxx>
> Date: Wed, 19 Oct 2011 11:44:41 +0200
> Subject: [PATCH] writeback: Include all dirty inodes in background writeback
> 
> Current livelock avoidance code makes background work to include only inodes
> that were dirtied before background writeback has started. However background
> writeback can be running for a long time and thus excluding newly dirtied
> inodes can eventually exclude significant portion of dirty inodes making
> background writeback inefficient. Since background writeback avoids livelocking
> the flusher thread by yielding to any other work, there is no real reason why
> background work should not include all dirty inodes so change the logic in
> wb_writeback().

Looks good to me. Thanks!

> Signed-off-by: Jan Kara <jack@xxxxxxx>
> ---
>  fs/fs-writeback.c |   10 ++++++++--
>  1 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> index 04cf3b9..8314241 100644
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -730,11 +730,17 @@ static long wb_writeback(struct bdi_writeback *wb,
>  		if (work->for_background && !over_bground_thresh())
>  			break;
>  
> +		/*
> +		 * Kupdate and background works are special and we want to
> +		 * include all inodes that need writing. Livelock avoidance is
> +		 * handled by these works yielding to any other work so we are
> +		 * safe.
> +		 */
>  		if (work->for_kupdate) {
>  			oldest_jif = jiffies -
>  				msecs_to_jiffies(dirty_expire_interval * 10);
> -			work->older_than_this = &oldest_jif;
> -		}
> +		} else if (work->for_background)
> +			oldest_jif = jiffies;
>  
>  		trace_writeback_start(wb->bdi, work);
>  		if (list_empty(&wb->b_io))
> -- 
> 1.7.1
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux