Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115935
b: refs/heads/master
c: b7abea9
h: refs/heads/master
i:
  115933: 459a325
  115931: c45abdd
  115927: c7d217b
  115919: 8f66269
  115903: 38a8d5f
v: v3
  • Loading branch information
KAMEZAWA Hiroyuki authored and Linus Torvalds committed Oct 20, 2008
1 parent d32aa5e commit e400046
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 073e587ec2cc377867e53d8b8959738a8e16cff6
refs/heads/master: b7abea9630bc8ffc663a751e46680db25c4cdf8d
2 changes: 1 addition & 1 deletion trunk/mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ void __remove_from_page_cache(struct page *page)
{
struct address_space *mapping = page->mapping;

mem_cgroup_uncharge_cache_page(page);
radix_tree_delete(&mapping->page_tree, page->index);
page->mapping = NULL;
mapping->nrpages--;
__dec_zone_page_state(page, NR_FILE_PAGES);
BUG_ON(page_mapped(page));
mem_cgroup_uncharge_cache_page(page);

/*
* Some filesystems seem to re-dirty the page even after
Expand Down
1 change: 1 addition & 0 deletions trunk/mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,7 @@ void mem_cgroup_uncharge_page(struct page *page)
void mem_cgroup_uncharge_cache_page(struct page *page)
{
VM_BUG_ON(page_mapped(page));
VM_BUG_ON(page->mapping);
__mem_cgroup_uncharge_common(page, MEM_CGROUP_CHARGE_TYPE_CACHE);
}

Expand Down
9 changes: 7 additions & 2 deletions trunk/mm/migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,6 @@ static int migrate_page_move_mapping(struct address_space *mapping,
__inc_zone_page_state(newpage, NR_FILE_PAGES);

spin_unlock_irq(&mapping->tree_lock);
if (!PageSwapCache(newpage))
mem_cgroup_uncharge_cache_page(page);

return 0;
}
Expand All @@ -341,6 +339,8 @@ static int migrate_page_move_mapping(struct address_space *mapping,
*/
static void migrate_page_copy(struct page *newpage, struct page *page)
{
int anon;

copy_highpage(newpage, page);

if (PageError(page))
Expand Down Expand Up @@ -378,8 +378,13 @@ static void migrate_page_copy(struct page *newpage, struct page *page)
#endif
ClearPagePrivate(page);
set_page_private(page, 0);
/* page->mapping contains a flag for PageAnon() */
anon = PageAnon(page);
page->mapping = NULL;

if (!anon) /* This page was removed from radix-tree. */
mem_cgroup_uncharge_cache_page(page);

/*
* If any waiters have accumulated on the new page then
* wake them up.
Expand Down

0 comments on commit e400046

Please sign in to comment.