Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190683
b: refs/heads/master
c: ad4ba37
h: refs/heads/master
i:
  190681: 430517d
  190679: 3d3ecd4
v: v3
  • Loading branch information
Paul E. McKenney committed May 4, 2010
1 parent 7916fc6 commit 63c32e1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 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: 1ce7e4ff24fe338438bc7837e02780f202bf202b
refs/heads/master: ad4ba375373937817404fd92239ef4cadbded23b
21 changes: 16 additions & 5 deletions trunk/mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,10 +811,12 @@ int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem)
* enabled in "curr" and "curr" is a child of "mem" in *cgroup*
* hierarchy(even if use_hierarchy is disabled in "mem").
*/
rcu_read_lock();
if (mem->use_hierarchy)
ret = css_is_ancestor(&curr->css, &mem->css);
else
ret = (curr == mem);
rcu_read_unlock();
css_put(&curr->css);
return ret;
}
Expand Down Expand Up @@ -2312,7 +2314,9 @@ mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout)

/* record memcg information */
if (do_swap_account && swapout && memcg) {
rcu_read_lock();
swap_cgroup_record(ent, css_id(&memcg->css));
rcu_read_unlock();
mem_cgroup_get(memcg);
}
if (swapout && memcg)
Expand Down Expand Up @@ -2369,8 +2373,10 @@ static int mem_cgroup_move_swap_account(swp_entry_t entry,
{
unsigned short old_id, new_id;

rcu_read_lock();
old_id = css_id(&from->css);
new_id = css_id(&to->css);
rcu_read_unlock();

if (swap_cgroup_cmpxchg(entry, old_id, new_id) == old_id) {
mem_cgroup_swap_statistics(from, false);
Expand Down Expand Up @@ -4038,11 +4044,16 @@ static int is_target_pte_for_mc(struct vm_area_struct *vma,
put_page(page);
}
/* throught */
if (ent.val && do_swap_account && !ret &&
css_id(&mc.from->css) == lookup_swap_cgroup(ent)) {
ret = MC_TARGET_SWAP;
if (target)
target->ent = ent;
if (ent.val && do_swap_account && !ret) {
unsigned short id;
rcu_read_lock();
id = css_id(&mc.from->css);
rcu_read_unlock();
if (id == lookup_swap_cgroup(ent)) {
ret = MC_TARGET_SWAP;
if (target)
target->ent = ent;
}
}
return ret;
}
Expand Down

0 comments on commit 63c32e1

Please sign in to comment.