lkml.org 
[lkml]   [2011]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/5] writeback: fix dirtied pages accounting on redirty
On Mon, 21 Nov 2011 21:03:46 +0800
Wu Fengguang <fengguang.wu@intel.com> 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?




\
 
 \ /
  Last update: 2011-11-21 22:55    [W:0.117 / U:0.928 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site