Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83784
b: refs/heads/master
c: ac44d35
h: refs/heads/master
v: v3
  • Loading branch information
Balbir Singh authored and Linus Torvalds committed Feb 7, 2008
1 parent e951088 commit 599b091
Show file tree
Hide file tree
Showing 2 changed files with 8 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: 217bc3194d57150549e9234e6ddfee30de28cc78
refs/heads/master: ac44d354d5c9ced49b1165d6496f134501134219
10 changes: 7 additions & 3 deletions trunk/mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,16 +456,20 @@ int mem_cgroup_charge(struct page *page, struct mm_struct *mm,
int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm,
gfp_t gfp_mask)
{
int ret = 0;
struct mem_cgroup *mem;
if (!mm)
mm = &init_mm;

rcu_read_lock();
mem = rcu_dereference(mm->mem_cgroup);
css_get(&mem->css);
rcu_read_unlock();
if (mem->control_type == MEM_CGROUP_TYPE_ALL)
return mem_cgroup_charge_common(page, mm, gfp_mask,
ret = mem_cgroup_charge_common(page, mm, gfp_mask,
MEM_CGROUP_CHARGE_TYPE_CACHE);
else
return 0;
css_put(&mem->css);
return ret;
}

/*
Expand Down

0 comments on commit 599b091

Please sign in to comment.