linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix mapping->writeback_index to point to the last written page
@ 2011-02-25  7:55 Jun'ichi Nomura
  2011-03-02 22:18 ` Jan Kara
  0 siblings, 1 reply; 7+ messages in thread
From: Jun'ichi Nomura @ 2011-02-25  7:55 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel

Hi,

For range-cyclic writeback (e.g. kupdate), the writeback code sets
a continuation point of the next writeback to mapping->writeback_index.

Current code sets the page next to the last written page.
I think it's intended for sequential writer.
However, in many cases, sequential writer is writing in the middle of the page
and it just redirties the last written page by continuing from that.

So the next writeback should try to continue from the last written page,
not the next one.
(If it's clean because the writer was on the page boundary,
 pagevec_lookup_tag just skips it. So no problem.)

Otherwise, the last written page was left dirty until the writeback
wraps around.

I.e. if the sequential dirtier has written on pagecache as '*'s below:

   |*******|*******|****---|-------|-------|     ( |---| is a page )

then, writeback happens:

   |-------|-------|-------|-------|-------|

and the dirtier continues:

   |-------|-------|----***|*******|*****--|
                   A       B

Next writeback should start from page A, not B.

As an exceptional case, when I/O error happens, set done_index to
the next page as the comment in the code suggests.


    Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>

diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 2cb01f6..beae3ed 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -927,7 +927,7 @@ retry:
 				break;
 			}
 
-			done_index = page->index + 1;
+			done_index = page->index;
 
 			lock_page(page);
 
@@ -977,6 +977,7 @@ continue_unlock:
 					 * not be suitable for data integrity
 					 * writeout).
 					 */
+					done_index = page->index + 1;
 					done = 1;
 					break;
 				}

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-03-04  2:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-25  7:55 [PATCH] Fix mapping->writeback_index to point to the last written page Jun'ichi Nomura
2011-03-02 22:18 ` Jan Kara
2011-03-03  2:26   ` Jun'ichi Nomura
2011-03-03 13:31     ` Wu Fengguang
2011-03-03 14:08       ` Jan Kara
2011-03-04  1:45         ` Jun'ichi Nomura
2011-03-04  2:20           ` Wu Fengguang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).