On Mon, 21 Nov 2011 21:03:46 +0800 Wu Fengguang <fengguang.wu@xxxxxxxxx> wrote: > De-account the accumulative dirty counters on page redirty. > > Page redirties (very common in ext4) will introduce mismatch between > counters (a) and (b) > > a) NR_DIRTIED, BDI_DIRTIED, tsk->nr_dirtied > b) NR_WRITTEN, BDI_WRITTEN > > This will introduce systematic errors in balanced_rate and result in > dirty page position errors (ie. the dirty pages are no longer balanced > around the global/bdi setpoints). > > ... > > --- linux-next.orig/mm/page-writeback.c 2011-11-17 20:57:15.000000000 +0800 > +++ linux-next/mm/page-writeback.c 2011-11-17 20:57:16.000000000 +0800 > @@ -1792,6 +1792,17 @@ int __set_page_dirty_nobuffers(struct pa > } > EXPORT_SYMBOL(__set_page_dirty_nobuffers); > > +void account_page_redirty(struct page *page) > +{ > + struct address_space *mapping = page->mapping; > + if (mapping && mapping_cap_account_dirty(mapping)) { > + current->nr_dirtied--; > + dec_zone_page_state(page, NR_DIRTIED); > + dec_bdi_stat(mapping->backing_dev_info, BDI_DIRTIED); > + } > +} Again, writeback doesn't seem to be the best place to be adding undocumented code. > +EXPORT_SYMBOL(account_page_redirty); The export is unneeded? -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html