diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2009-01-06 17:39:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-06 18:59:00 -0500 |
commit | 82fd1a9a8ced9607312b54859572bcc6211e8919 (patch) | |
tree | fc537a866c670a4c54895a7f75b5ccfbdeeb034c /mm/page-writeback.c | |
parent | d5482cdf8a0aacb1e6468a97d5544f5829c8d8c4 (diff) |
mm: write_cache_pages more terminate quickly
Now that we have the early-termination logic in place, it makes sense to
bail out early in all other cases where done is set to 1.
Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Dave Chinner <david@fromorbit.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page-writeback.c')
-rw-r--r-- | mm/page-writeback.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 0d986c13d473..08d2b960b294 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c | |||
@@ -983,12 +983,15 @@ continue_unlock: | |||
983 | 983 | ||
984 | if (wbc->sync_mode == WB_SYNC_NONE) { | 984 | if (wbc->sync_mode == WB_SYNC_NONE) { |
985 | wbc->nr_to_write--; | 985 | wbc->nr_to_write--; |
986 | if (wbc->nr_to_write <= 0) | 986 | if (wbc->nr_to_write <= 0) { |
987 | done = 1; | 987 | done = 1; |
988 | break; | ||
989 | } | ||
988 | } | 990 | } |
989 | if (wbc->nonblocking && bdi_write_congested(bdi)) { | 991 | if (wbc->nonblocking && bdi_write_congested(bdi)) { |
990 | wbc->encountered_congestion = 1; | 992 | wbc->encountered_congestion = 1; |
991 | done = 1; | 993 | done = 1; |
994 | break; | ||
992 | } | 995 | } |
993 | } | 996 | } |
994 | pagevec_release(&pvec); | 997 | pagevec_release(&pvec); |