Commit 22ef37eed673587ac984965dc88ba94c68873291

Authored by Toshiyuki Okajima
Committed by Linus Torvalds
1 parent cd208bcc7c

page-writeback: fix the calculation of the oldest_jif in wb_kupdate()

wb_kupdate() function has a bug on linux-2.6.30-rc5.  This bug causes
generic_sync_sb_inodes() to start to write inodes back much earlier than
our expectations because it miscalculates oldest_jif in wb_kupdate().

This bug was introduced in 704503d836042d4a4c7685b7036e7de0418fbc0f
('mm: fix proc_dointvec_userhz_jiffies "breakage"').

Signed-off-by: Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff

... ... @@ -94,12 +94,12 @@
94 94 /*
95 95 * The interval between `kupdate'-style writebacks
96 96 */
97   -unsigned int dirty_writeback_interval = 5 * 100; /* sentiseconds */
  97 +unsigned int dirty_writeback_interval = 5 * 100; /* centiseconds */
98 98  
99 99 /*
100 100 * The longest time for which data is allowed to remain dirty
101 101 */
102   -unsigned int dirty_expire_interval = 30 * 100; /* sentiseconds */
  102 +unsigned int dirty_expire_interval = 30 * 100; /* centiseconds */
103 103  
104 104 /*
105 105 * Flag that makes the machine dump writes/reads and block dirtyings.
... ... @@ -770,7 +770,7 @@
770 770  
771 771 sync_supers();
772 772  
773   - oldest_jif = jiffies - msecs_to_jiffies(dirty_expire_interval);
  773 + oldest_jif = jiffies - msecs_to_jiffies(dirty_expire_interval * 10);
774 774 start_jif = jiffies;
775 775 next_jif = start_jif + msecs_to_jiffies(dirty_writeback_interval * 10);
776 776 nr_to_write = global_page_state(NR_FILE_DIRTY) +