Skip to content

Commit

Permalink
mm: page-writeback: inline account_page_dirtied() into single caller
Browse files Browse the repository at this point in the history
A follow-up patch would have changed the call signature.  To save the
trouble, just fold it instead.

Signed-off-by: Johannes Weiner <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Vladimir Davydov <[email protected]>
Cc: <[email protected]>	[3.17.x]
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
hnaz authored and torvalds committed Oct 29, 2014
1 parent ea5d05b commit 3a3c02e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
1 change: 0 additions & 1 deletion include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,6 @@ int __set_page_dirty_no_writeback(struct page *page);
int redirty_page_for_writepage(struct writeback_control *wbc,
struct page *page);
void account_page_dirtied(struct page *page, struct address_space *mapping);
void account_page_writeback(struct page *page);
int set_page_dirty(struct page *page);
int set_page_dirty_lock(struct page *page);
int clear_page_dirty_for_io(struct page *page);
Expand Down
23 changes: 4 additions & 19 deletions mm/page-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -2115,23 +2115,6 @@ void account_page_dirtied(struct page *page, struct address_space *mapping)
}
EXPORT_SYMBOL(account_page_dirtied);

/*
* Helper function for set_page_writeback family.
*
* The caller must hold mem_cgroup_begin/end_update_page_stat() lock
* while calling this function.
* See test_set_page_writeback for example.
*
* NOTE: Unlike account_page_dirtied this does not rely on being atomic
* wrt interrupts.
*/
void account_page_writeback(struct page *page)
{
mem_cgroup_inc_page_stat(page, MEM_CGROUP_STAT_WRITEBACK);
inc_zone_page_state(page, NR_WRITEBACK);
}
EXPORT_SYMBOL(account_page_writeback);

/*
* For address_spaces which do not use buffers. Just tag the page as dirty in
* its radix tree.
Expand Down Expand Up @@ -2410,8 +2393,10 @@ int __test_set_page_writeback(struct page *page, bool keep_write)
} else {
ret = TestSetPageWriteback(page);
}
if (!ret)
account_page_writeback(page);
if (!ret) {
mem_cgroup_inc_page_stat(page, MEM_CGROUP_STAT_WRITEBACK);
inc_zone_page_state(page, NR_WRITEBACK);
}
mem_cgroup_end_update_page_stat(page, &locked, &memcg_flags);
return ret;

Expand Down

0 comments on commit 3a3c02e

Please sign in to comment.