提交 8d38633c 编写于 作者: K Konstantin Khebnikov 提交者: Linus Torvalds

page_writeback: put account_page_redirty() after set_page_dirty()

Helper account_page_redirty() fixes dirty pages counter for redirtied
pages.  This patch puts it after dirtying and prevents temporary
underflows of dirtied pages counters on zone/bdi and current->nr_dirtied.
Signed-off-by: NKonstantin Khebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 b30fe6c7
...@@ -1407,8 +1407,8 @@ int extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end) ...@@ -1407,8 +1407,8 @@ int extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end)
while (index <= end_index) { while (index <= end_index) {
page = find_get_page(inode->i_mapping, index); page = find_get_page(inode->i_mapping, index);
BUG_ON(!page); /* Pages should be in the extent_io_tree */ BUG_ON(!page); /* Pages should be in the extent_io_tree */
account_page_redirty(page);
__set_page_dirty_nobuffers(page); __set_page_dirty_nobuffers(page);
account_page_redirty(page);
page_cache_release(page); page_cache_release(page);
index++; index++;
} }
......
...@@ -2168,9 +2168,12 @@ EXPORT_SYMBOL(account_page_redirty); ...@@ -2168,9 +2168,12 @@ EXPORT_SYMBOL(account_page_redirty);
*/ */
int redirty_page_for_writepage(struct writeback_control *wbc, struct page *page) int redirty_page_for_writepage(struct writeback_control *wbc, struct page *page)
{ {
int ret;
wbc->pages_skipped++; wbc->pages_skipped++;
ret = __set_page_dirty_nobuffers(page);
account_page_redirty(page); account_page_redirty(page);
return __set_page_dirty_nobuffers(page); return ret;
} }
EXPORT_SYMBOL(redirty_page_for_writepage); EXPORT_SYMBOL(redirty_page_for_writepage);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册