Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 86827
b: refs/heads/master
c: fb59e9f
h: refs/heads/master
i:
  86825: 093c1e9
  86823: 9de700c
v: v3
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Mar 5, 2008
1 parent ceaf898 commit a88f85c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 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: 9b3c0a07e0fca35e36751680de3e4c76dbff5df3
refs/heads/master: fb59e9f1e9786635ea12e12bf6adbb132e10f979
17 changes: 9 additions & 8 deletions trunk/mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,13 +623,13 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm,
goto retry;
}
page_assign_page_cgroup(page, pc);
unlock_page_cgroup(page);

mz = page_cgroup_zoneinfo(pc);
spin_lock_irqsave(&mz->lru_lock, flags);
__mem_cgroup_add_list(pc);
spin_unlock_irqrestore(&mz->lru_lock, flags);

unlock_page_cgroup(page);
done:
return 0;
out:
Expand Down Expand Up @@ -677,14 +677,14 @@ void mem_cgroup_uncharge_page(struct page *page)
VM_BUG_ON(pc->ref_cnt <= 0);

if (--(pc->ref_cnt) == 0) {
page_assign_page_cgroup(page, NULL);
unlock_page_cgroup(page);

mz = page_cgroup_zoneinfo(pc);
spin_lock_irqsave(&mz->lru_lock, flags);
__mem_cgroup_remove_list(pc);
spin_unlock_irqrestore(&mz->lru_lock, flags);

page_assign_page_cgroup(page, NULL);
unlock_page_cgroup(page);

mem = pc->mem_cgroup;
res_counter_uncharge(&mem->res, PAGE_SIZE);
css_put(&mem->css);
Expand Down Expand Up @@ -736,23 +736,24 @@ void mem_cgroup_page_migration(struct page *page, struct page *newpage)
return;
}

page_assign_page_cgroup(page, NULL);
unlock_page_cgroup(page);

mz = page_cgroup_zoneinfo(pc);
spin_lock_irqsave(&mz->lru_lock, flags);
__mem_cgroup_remove_list(pc);
spin_unlock_irqrestore(&mz->lru_lock, flags);

page_assign_page_cgroup(page, NULL);
unlock_page_cgroup(page);

pc->page = newpage;
lock_page_cgroup(newpage);
page_assign_page_cgroup(newpage, pc);
unlock_page_cgroup(newpage);

mz = page_cgroup_zoneinfo(pc);
spin_lock_irqsave(&mz->lru_lock, flags);
__mem_cgroup_add_list(pc);
spin_unlock_irqrestore(&mz->lru_lock, flags);

unlock_page_cgroup(newpage);
}

/*
Expand Down

0 comments on commit a88f85c

Please sign in to comment.