提交 82fd1a9a 编写于 作者: A Andrew Morton 提交者: Linus Torvalds

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: NNick Piggin <npiggin@suse.de>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Dave Chinner <david@fromorbit.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 d5482cdf
...@@ -983,12 +983,15 @@ int write_cache_pages(struct address_space *mapping, ...@@ -983,12 +983,15 @@ int write_cache_pages(struct address_space *mapping,
if (wbc->sync_mode == WB_SYNC_NONE) { if (wbc->sync_mode == WB_SYNC_NONE) {
wbc->nr_to_write--; wbc->nr_to_write--;
if (wbc->nr_to_write <= 0) if (wbc->nr_to_write <= 0) {
done = 1; done = 1;
break;
}
} }
if (wbc->nonblocking && bdi_write_congested(bdi)) { if (wbc->nonblocking && bdi_write_congested(bdi)) {
wbc->encountered_congestion = 1; wbc->encountered_congestion = 1;
done = 1; done = 1;
break;
} }
} }
pagevec_release(&pvec); pagevec_release(&pvec);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册