From: Chuck Ebbert <cebbert@redhat.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: richard kennedy <richard@rsk.demon.co.uk>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] balance_dirty_pages - exit loop when no more pages available
Date: Thu, 02 Aug 2007 15:54:14 -0400 [thread overview]
Message-ID: <46B23666.3020205@redhat.com> (raw)
In-Reply-To: <1185901890.3133.33.camel@castor.rsk.org>
On 07/31/2007 01:11 PM, richard kennedy wrote:
Peter, did you see this?
> exit loop in balance_dirty_pages when no more pages available to write
>
> On a bdi that has very little traffic balance_dirty_pages can loop
> needlessly waiting until do_writepages has written enough pages.
>
> do_writepages will return encountered_congestion==0 && nr_to_write > 0
> when it has completed a pass but did not find enough pages available to
> write. balance_dirty_pages ignores this and keeps looping until a total
> of chunk pages was written.
>
> this patch adds an extra exit condition to break out of the loop in this
> case.
>
> I've tested this on my amd64 desktop, and I also have a version of this
> patch that includes a printk and a test case that occasionally does
> trigger this condition.
>
> Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
>
> ------
> --- linux-2.6.22.1/mm/page-writeback.c.orig 2007-07-30 16:36:09.000000000 +0100
> +++ linux-2.6.22.1/mm/page-writeback.c 2007-07-31 16:26:43.000000000 +0100
> @@ -250,6 +250,8 @@ static void balance_dirty_pages(struct a
> pages_written += write_chunk - wbc.nr_to_write;
> if (pages_written >= write_chunk)
> break; /* We've done our duty */
> + if (!wbc.encountered_congestion && wbc.nr_to_write > 0)
> + break; /* didn't find enough to do */
> }
> congestion_wait(WRITE, HZ/10);
> }
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2007-08-02 19:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-31 17:11 richard kennedy
2007-08-02 19:54 ` Chuck Ebbert [this message]
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=46B23666.3020205@redhat.com \
--to=cebbert@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=richard@rsk.demon.co.uk \
/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