public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Chris Mason <chris.mason@oracle.com>
Cc: linux-kernel@vger.kernel.org, jens.axboe@oracle.com, jack@suse.cz
Subject: Re: [PATCH] bdi_sync_writeback should WB_SYNC_NONE first
Date: Sun, 27 Sep 2009 01:34:58 -0700	[thread overview]
Message-ID: <20090927013458.53e43459.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090925141014.GB15853@think>

On Fri, 25 Sep 2009 10:10:14 -0400 Chris Mason <chris.mason@oracle.com> wrote:

> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> index 8e1e5e1..27f8e0e 100644
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -225,7 +225,7 @@ static void bdi_sync_writeback(struct backing_dev_info *bdi,
>  {
>  	struct wb_writeback_args args = {
>  		.sb		= sb,
> -		.sync_mode	= WB_SYNC_ALL,
> +		.sync_mode	= WB_SYNC_NONE,
>  		.nr_pages	= LONG_MAX,
>  		.range_cyclic	= 0,
>  	};
> @@ -236,6 +236,13 @@ static void bdi_sync_writeback(struct backing_dev_info *bdi,
>  
>  	bdi_queue_work(bdi, &work);
>  	bdi_wait_on_work_clear(&work);
> +
> +	args.sync_mode = WB_SYNC_ALL;
> +	args.nr_pages = LONG_MAX;
> +
> +	work.state = WS_USED | WS_ONSTACK;
> +	bdi_queue_work(bdi, &work);
> +	bdi_wait_on_work_clear(&work);
>  }

Those LONG_MAX's are a worry.  What prevents a very long
almost-livelock from occurring if userspace is concurrently dirtying
pagecache at a high rate?


  reply	other threads:[~2009-09-27  8:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-25 14:10 [PATCH] bdi_sync_writeback should WB_SYNC_NONE first Chris Mason
2009-09-27  8:34 ` Andrew Morton [this message]
2009-09-27 16:44   ` Jens Axboe
2009-09-27 16:52     ` Andrew Morton
2009-09-27 16:55       ` Jens Axboe
2009-09-27 17:10         ` Andrew Morton
2009-09-29 16:13           ` Jan Kara
2009-09-28 13:32   ` Chris Mason
2009-09-29 20:47 ` Chris Mason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090927013458.53e43459.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=chris.mason@oracle.com \
    --cc=jack@suse.cz \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox